package com.ciwong.epaper.modules.epaper.dao;

import android.text.TextUtils;
import android.util.Log;

import com.android.volley.AuthFailureError;
import com.android.volley.Request;
import com.android.volley.Response;
import com.android.volley.VolleyError;
import com.ciwong.epaper.application.EApplication;
import com.ciwong.epaper.application.EpaperConstant;
import com.ciwong.epaper.modules.bookstore.bean.PubLishClassBean;
import com.ciwong.epaper.modules.bookstore.bean.PublishWorkContent;
import com.ciwong.epaper.modules.bookstore.bean.PublishWorkContentUpload;
import com.ciwong.epaper.modules.bookstore.bean.PublishWorkResult;
import com.ciwong.epaper.modules.clazz.bean.StudentBean;
import com.ciwong.epaper.modules.clazz.bean.TeacherClassBean;
import com.ciwong.epaper.modules.epaper.bean.BasePaging;
import com.ciwong.epaper.modules.epaper.bean.BookCaseBean;
import com.ciwong.epaper.modules.epaper.bean.CatelogBean;
import com.ciwong.epaper.modules.epaper.bean.DeleteEP;
import com.ciwong.epaper.modules.epaper.bean.DeleteEpInfo;
import com.ciwong.epaper.modules.epaper.bean.EpaperInfo;
import com.ciwong.epaper.modules.epaper.bean.FollowReadWordDetails;
import com.ciwong.epaper.modules.epaper.bean.FollowreadTextParagraph;
import com.ciwong.epaper.modules.epaper.bean.GradeBean;
import com.ciwong.epaper.modules.epaper.bean.ListenSpeakExAminAtion;
import com.ciwong.epaper.modules.epaper.bean.Module;
import com.ciwong.epaper.modules.epaper.bean.MyGrade;
import com.ciwong.epaper.modules.epaper.bean.NewBook;
import com.ciwong.epaper.modules.epaper.bean.PublishResource;
import com.ciwong.epaper.modules.epaper.bean.ResourceContent;
import com.ciwong.epaper.modules.epaper.bean.Result_scoce;
import com.ciwong.epaper.modules.epaper.bean.SearchBookKeyNameBean;
import com.ciwong.epaper.modules.epaper.bean.Subject;
import com.ciwong.epaper.modules.epaper.bean.TempWorkAnswers;
import com.ciwong.epaper.modules.epaper.bean.UserEpage;
import com.ciwong.epaper.modules.epaper.bean.VideoExplainWorkAnswers;
import com.ciwong.epaper.modules.epaper.bean.VideoRecord;
import com.ciwong.epaper.modules.epaper.bean.ZipPackageInfo;
import com.ciwong.epaper.modules.homework.bean.ClassWorkRecordsPageBean;
import com.ciwong.epaper.modules.me.bean.AdsBean;
import com.ciwong.epaper.modules.me.bean.BookDeskBean;
import com.ciwong.epaper.modules.me.bean.BookDeskCataloguesBean;
import com.ciwong.epaper.modules.me.bean.BookMarkPageInfo;
import com.ciwong.epaper.modules.me.bean.CheckValidBean;
import com.ciwong.epaper.modules.me.bean.EpaperInfoGradeCategoryBean;
import com.ciwong.epaper.modules.me.bean.FavoritesBookPageBean;
import com.ciwong.epaper.modules.me.bean.FollowTeacher;
import com.ciwong.epaper.modules.me.bean.KefuBean;
import com.ciwong.epaper.modules.me.bean.MyWork;
import com.ciwong.epaper.modules.me.bean.PlanBean;
import com.ciwong.epaper.modules.me.bean.PublishBook;
import com.ciwong.epaper.modules.me.bean.PublishDKWorkRecordsPageBean;
import com.ciwong.epaper.modules.me.bean.PublishWorkRecordsPageBean;
import com.ciwong.epaper.modules.me.bean.ServiceProductsBean;
import com.ciwong.epaper.modules.msg.bean.Ad;
import com.ciwong.epaper.modules.msg.bean.WorkContent;
import com.ciwong.epaper.util.BaseExtCallBack;
import com.ciwong.epaper.util.DeviceUtil;
import com.ciwong.epaper.util.EConstants;
import com.ciwong.epaper.util.FeedbackUtil;
import com.ciwong.libs.utils.CWLog;
import com.ciwong.libs.utils.volley.BaseRequest;
import com.ciwong.libs.utils.volley.HttpRequest;
import com.ciwong.mobilelib.i.BaseCallBack;
import com.ciwong.mobilelib.utils.BaseRequestUtil;
import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;

import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;

import java.io.UnsupportedEncodingException;
import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * 电子报 相关网络请求
 *
 * @author bin
 * @version ciwong v.1.0 2015/7/23 19:52
 * @since ciwong v.1.0
 */
public class EpaperRequest {
    /**
     * 根据服务ID获取书籍
     *
     * @param schoolId 学校ID
     * @param brandId  服务ID
     * @param callBack 回调
     */
    public static void getAdvisor(long schoolId, long brandId, final BaseCallBack callBack) {
        Map<String, String> params = new HashMap<String, String>();
        params.put(HttpRequest.REQUEST_MODULES, EpaperAction.class.getName());
        params.put(HttpRequest.REQUEST_ACTION,
                EpaperAction.ACTION_GET_EPAGE_ADVISOR);
        params.put("sIds", schoolId + "");
        params.put("brandId", brandId + "");
        HttpRequest request = new HttpRequest(params,
                new Response.ErrorListener() {

                    @Override
                    public void onErrorResponse(VolleyError error) {
                        callBack.failed(error);
                    }
                }, new BaseRequest.ResponseCallback() {

            @Override
            public void error(int errorCode, String msg) {
                callBack.failed(errorCode, msg);
            }

            @Override
            public void success(Object obj, int resultCode,
                                int errorCode, String msg) {
                if (resultCode == 0 && errorCode == 0) {
                    callBack.success(obj);
                } else {
                    callBack.failed(errorCode, msg);
                }
            }
        });
        request.setResponseDataType(HttpRequest.RESPONSE_DATA_TYPE_OBJECT);
        Type responseType = new TypeToken<List<KefuBean>>() {
        }.getType();
        request.setResponseType(responseType);
        BaseRequestUtil.getInstance().add(request);
        callBack.setUrl(request.getUrl());
    }

    /**
     * 根据服务ID获取书籍
     *
     * @param schoolId  学校ID
     * @param serviceId 服务ID
     * @param page      页码
     * @param pageSize  每页条数
     * @param callBack  回调
     */
    public static void getServiceBooks(long schoolId, long serviceId, int page,
                                       int pageSize, final BaseCallBack callBack) {
        Map<String, String> params = new HashMap<String, String>();
        params.put(HttpRequest.REQUEST_MODULES, EpaperAction.class.getName());
        params.put(HttpRequest.REQUEST_ACTION,
                EpaperAction.ACTION_GET_SERVICE_BOOKS);
        params.put("schoolId", schoolId + "");
        params.put("serviceId", serviceId + "");
        params.put("pageIndex", page + "");
        params.put("pageSize", pageSize + "");
        HttpRequest request = new HttpRequest(params,
                new Response.ErrorListener() {

                    @Override
                    public void onErrorResponse(VolleyError error) {
                        callBack.failed(error);
                    }
                }, new BaseRequest.ResponseCallback() {

            @Override
            public void error(int errorCode, String msg) {
                callBack.failed(errorCode, msg);
            }

            @Override
            public void success(Object obj, int resultCode,
                                int errorCode, String msg) {
                if (resultCode == 0 && errorCode == 0) {
                    callBack.success(obj);
                } else {
                    callBack.failed(errorCode, msg);
                }
            }
        });
        request.setResponseDataType(HttpRequest.RESPONSE_DATA_TYPE_OBJECT);
        Type responseType = new TypeToken<BasePaging<EpaperInfo>>() {
        }.getType();
        request.setResponseType(responseType);
        BaseRequestUtil.getInstance().add(request);
        callBack.setUrl(request.getUrl());
    }

    /**
     * 新增接口
     * @param typeID
     * @param callBack
     */
    public static void getGradeByBookCategoryId(int typeID,final BaseExtCallBack callBack) {
        Map<String, String> params = new HashMap<String, String>();
        params.put(HttpRequest.REQUEST_MODULES, EpaperAction.class.getName());
        params.put(HttpRequest.REQUEST_ACTION,
                EpaperAction.ACTION_GET_TEACHER_GRADE_BY_CATEGORY);
        params.put("typeId", typeID + "");
        params.put("clientId", EConstants.CLIENT_ID);
        HttpRequest request = new HttpRequest(params,
                new Response.ErrorListener() {

                    @Override
                    public void onErrorResponse(VolleyError error) {
                        callBack.failed(error);
                    }
                }, new BaseRequest.ResponseCallback() {

            @Override
            public void error(int errorCode, String msg) {
                callBack.failed(errorCode, msg);
            }

            @Override
            public void success(Object obj, int resultCode,
                                int errorCode, String msg) {
                if (resultCode == 0 && errorCode == 0) {
                    callBack.success(obj);
                } else {
                    callBack.failed(errorCode, msg);
                }
            }
        });
        request.setResponseDataType(HttpRequest.RESPONSE_DATA_TYPE_OBJECT);
        Type responseType = new TypeToken<List<EpaperInfoGradeCategoryBean>>() {
        }.getType();
        request.setResponseType(responseType);
        BaseRequestUtil.getInstance().add(request);
        callBack.setUrl(request.getUrl());
    }



    /**
     * 根据品牌ID获取书籍
     *
     * @param brandId
     * @param callBack
     */
    public static void getEpageBookcase(int brandId, int pageIndex, int pageSize, final BaseCallBack callBack) {
        Map<String, String> params = new HashMap<String, String>();
        params.put(HttpRequest.REQUEST_MODULES, EpaperAction.class.getName());
        params.put(HttpRequest.REQUEST_ACTION,
                EpaperAction.ACTION_SELECT_EPAGE_BOOKCASE);
        params.put("brandId", brandId + "");
        params.put("pageIndex", pageIndex + "");
        params.put("pageSize", pageSize + "");

        HttpRequest request = new HttpRequest(params,
                new Response.ErrorListener() {

                    @Override
                    public void onErrorResponse(VolleyError error) {
                        callBack.failed(error);
                    }
                }, new BaseRequest.ResponseCallback() {

            @Override
            public void error(int errorCode, String msg) {
                callBack.failed(errorCode, msg);
            }

            @Override
            public void success(Object obj, int resultCode,
                                int errorCode, String msg) {
                if (resultCode == 0 && errorCode == 0) {
                    callBack.success(obj);
                } else {
                    callBack.failed(errorCode, msg);
                }
            }
        });
        request.setResponseDataType(HttpRequest.RESPONSE_DATA_TYPE_OBJECT);
        request.setResponseClazz(UserEpage.class);
        BaseRequestUtil.getInstance().add(request);
        callBack.setUrl(request.getUrl());
    }

    /**
     * 根据品牌ID获取书籍
     *
     * @param brandId
     * @param callBack
     */
    public static void getEpageBookcaseAll(int brandId, final BaseCallBack callBack) {
        Map<String, String> params = new HashMap<String, String>();
        params.put(HttpRequest.REQUEST_MODULES, EpaperAction.class.getName());
        params.put(HttpRequest.REQUEST_ACTION,
                EpaperAction.ACTION_SELECT_EPAGE_BOOKCASE_ALL);
        params.put("brandId", brandId + "");

        HttpRequest request = new HttpRequest(params,
                new Response.ErrorListener() {

                    @Override
                    public void onErrorResponse(VolleyError error) {
                        callBack.failed(error);
                    }
                }, new BaseRequest.ResponseCallback() {

            @Override
            public void error(int errorCode, String msg) {
                callBack.failed(errorCode, msg);
            }

            @Override
            public void success(Object obj, int resultCode,
                                int errorCode, String msg) {
                if (resultCode == 0 && errorCode == 0) {
                    callBack.success(obj);
                } else {
                    callBack.failed(errorCode, msg);
                }
            }
        });
        request.setResponseDataType(HttpRequest.RESPONSE_DATA_TYPE_OBJECT);
        request.setResponseClazz(UserEpage.class);
        BaseRequestUtil.getInstance().add(request);
        callBack.setUrl(request.getUrl());
    }

    /**
     * * 根据关键字搜索书籍
     *
     * @param brandId
     * @param grade
     * @param serviceId
     * @param keyWords
     * @param pageIndex
     * @param pageSize
     * @param baseCallBack
     */
    public static void getSearchingBookListByKyeWord(String brandId, String grade, String serviceId, String keyWords, int pageIndex, int pageSize, final BaseCallBack baseCallBack) {

        getUserProductByKey(brandId, grade, serviceId, keyWords, pageIndex, pageSize, baseCallBack);
//        Map<String, String> params = new HashMap<String, String>();
//        params.put(HttpRequest.REQUEST_MODULES, EpaperAction.class.getName());
//        params.put(HttpRequest.REQUEST_ACTION,
//                EpaperAction.ACTION_GET_BOOK_BY_SERVICEID_ANDKEYWORD);
//        params.put("brandId", brandId + "");
////        params.put("sIds", serviceIds);
//        params.put("pIndex", page + "");
//        params.put("psize", pageSize + "");
//        try {
//            String keyWords = java.net.URLEncoder.encode(searching_book_str, "UTF-8");
//            params.put("keyWords", keyWords);
//        } catch (UnsupportedEncodingException e) {
//            e.printStackTrace();
//        }
//
//
//        HttpRequest request = new HttpRequest(params,
//                new Response.ErrorListener() {
//
//                    @Override
//                    public void onErrorResponse(VolleyError error) {
//                        callBack.failed(error);
//                    }
//                }, new BaseRequest.ResponseCallback() {
//
//            @Override
//            public void error(int errorCode, String msg) {
//                callBack.failed(errorCode, msg);
//
//            }
//
//            @Override
//            public void success(Object obj, int resultCode,
//                                int errorCode, String msg) {
//                if (resultCode == 0 && errorCode == 0) {
//                    callBack.success(obj);
//                } else {
//                    callBack.failed(errorCode, msg);
//                }
//            }
//        });
//        request.setResponseDataType(HttpRequest.RESPONSE_DATA_TYPE_OBJECT);
//        Type responseType = new TypeToken<BasePaging<EpaperInfo>>() {
//        }.getType();
//        request.setResponseType(responseType);
//        BaseRequestUtil.getInstance().add(request);
    }


    public static void searchBookAndService(int brandId, int page,
                                            int pageSize, int gradeId, int subjectId, int salesType, String searching_book_str, final BaseCallBack callBack) {

        Map<String, String> params = new HashMap<String, String>();
        params.put(HttpRequest.REQUEST_MODULES, EpaperAction.class.getName());
        params.put(HttpRequest.REQUEST_ACTION,
                EpaperAction.ACTION_SEARCH_BOOK_AND_SERVICE);

        params.put("brandId", brandId + "");
//        params.put("sIds", serviceIds);
        params.put("pIndex", page + "");
        params.put("psize", pageSize + "");

        params.put("gradeId", gradeId + "");
        params.put("subjectId", subjectId + "");

        params.put("salesType", salesType + "");


        try {
            String keyWords = java.net.URLEncoder.encode(searching_book_str, "UTF-8");
            params.put("keyWords", keyWords);
        } catch (UnsupportedEncodingException e) {
            e.printStackTrace();
        }


        HttpRequest request = new HttpRequest(params,
                new Response.ErrorListener() {

                    @Override
                    public void onErrorResponse(VolleyError error) {
                        callBack.failed(error);
                    }
                }, new BaseRequest.ResponseCallback() {

            @Override
            public void error(int errorCode, String msg) {
                callBack.failed(errorCode, msg);

            }

            @Override
            public void success(Object obj, int resultCode,
                                int errorCode, String msg) {
                if (resultCode == 0 && errorCode == 0) {
                    callBack.success(obj);
                } else {
                    callBack.failed(errorCode, msg);
                }
            }
        });
        request.setResponseDataType(HttpRequest.RESPONSE_DATA_TYPE_OBJECT);
        Type responseType = new TypeToken<BasePaging<NewBook>>() {
        }.getType();
        request.setResponseType(responseType);
        BaseRequestUtil.getInstance().add(request);
        callBack.setUrl(request.getUrl());
    }


    /**
     * 根据服务ID、页码、页数获得书籍列表
     *
     * @param brandId
     * @param serviceIds
     * @param page
     * @param pageSize
     * @param callBack
     */
    public static void getBookListByServiceID(int brandId, String serviceIds, int page,
                                              int pageSize, final BaseCallBack callBack) {
        Map<String, String> params = new HashMap<String, String>();
        params.put(HttpRequest.REQUEST_MODULES, EpaperAction.class.getName());
        params.put(HttpRequest.REQUEST_ACTION,
                EpaperAction.ACTION_GET_BOOK_BY_SERVICEID_ANDKEYWORD);
        params.put("brandId", brandId + "");
        params.put("sIds", serviceIds);
        params.put("pIndex", page + "");
        params.put("psize", pageSize + "");
        HttpRequest request = new HttpRequest(params,
                new Response.ErrorListener() {
                    @Override
                    public void onErrorResponse(VolleyError error) {
                        callBack.failed(error);
                    }
                }, new BaseRequest.ResponseCallback() {

            @Override
            public void error(int errorCode, String msg) {
                callBack.failed(errorCode, msg);

            }

            @Override
            public void success(Object obj, int resultCode,
                                int errorCode, String msg) {
                if (resultCode == 0 && errorCode == 0) {
                    callBack.success(obj);
                } else {
                    callBack.failed(errorCode, msg);
                }
            }
        });
        request.setResponseDataType(HttpRequest.RESPONSE_DATA_TYPE_OBJECT);
        Type responseType = new TypeToken<BasePaging<EpaperInfo>>() {
        }.getType();
        request.setResponseType(responseType);
        BaseRequestUtil.getInstance().add(request);
        callBack.setUrl(request.getUrl());
    }

    /**
     * 获取书籍目录
     *
     * @param packageId 资源包ID
     * @param cId       书籍目录ID(全部：-1)
     * @param tag       网络请求tag
     * @param callBack  回调
     */
    public static void getBookCatalogue(String packageId, String userId, String cId, String mServiceId,
                                        Object tag, final BaseCallBack callBack) {
        Map<String, String> params = new HashMap<String, String>();
        params.put(HttpRequest.REQUEST_MODULES, EpaperAction.class.getName());
        params.put(HttpRequest.REQUEST_ACTION,
                EpaperAction.ACTION_BOOK_CATALOGUES);
        params.put("packageId", packageId);
        params.put("cId", cId);
        params.put("userId", userId);
        params.put("serviceId", mServiceId);
//        params.put("scope","all");
//        params.put("termtype","2");
        HttpRequest request = new HttpRequest(params,
                new Response.ErrorListener() {

                    @Override
                    public void onErrorResponse(VolleyError error) {
                        callBack.failed(error);
                    }
                }, new BaseRequest.ResponseCallback() {

            @Override
            public void error(int errorCode, String msg) {
                callBack.failed(errorCode, msg);
            }

            @Override
            public void success(Object obj, int resultCode,
                                int errorCode, String msg) {
                if (resultCode == 0 && errorCode == 0) {
                    callBack.success(obj);
                } else {
                    callBack.failed(errorCode, msg);
                }
            }
        });
        request.setResponseDataType(HttpRequest.RESPONSE_DATA_TYPE_OBJECT);
        //后台没数据临时
//        Type responseType = new TypeToken<List<CatalogueInfo>>() {
//        }.getType();
//        request.setResponseType(responseType);
        request.setResponseClazz(CatelogBean.class);
        BaseRequestUtil.getInstance().add(request, tag);
        callBack.setUrl(request.getUrl());

    }


    /**
     * 获取书籍目录
     *
     * @param packageId 资源包ID
     * @param cId       书籍目录ID(全部：-1)
     * @param tag       网络请求tag
     * @param callBack  回调
     */
    public static void getCatalogueResourceList(String packageId, String cId,
                                                Object tag, boolean isFromDesk, final BaseCallBack callBack) {
        Map<String, String> params = new HashMap<String, String>();
        if (isFromDesk) {
            params.put(HttpRequest.REQUEST_MODULES, EpaperAction.class.getName());
            params.put(HttpRequest.REQUEST_ACTION,
                    EpaperAction.ACTION_CATALOGUES_RESOURCE_FORMDESK);
            params.put("packageId", packageId);
            params.put("unitId", cId);

        } else {
            params.put(HttpRequest.REQUEST_MODULES, EpaperAction.class.getName());
            params.put(HttpRequest.REQUEST_ACTION,
                    EpaperAction.ACTION_TEA_CATALOGUES_RESOURCE);
            params.put("packageId", packageId);
            params.put("cId", cId);

        }

        HttpRequest request = new HttpRequest(params,
                new Response.ErrorListener() {

                    @Override
                    public void onErrorResponse(VolleyError error) {
                        callBack.failed(error);
                    }
                }, new BaseRequest.ResponseCallback() {

            @Override
            public void error(int errorCode, String msg) {
                callBack.failed(errorCode, msg);
            }

            @Override
            public void success(Object obj, int resultCode,
                                int errorCode, String msg) {
                if (resultCode == 0 && errorCode == 0) {
                    callBack.success(obj);
                } else {
                    callBack.failed(errorCode, msg);
                }
            }
        });
        request.setResponseDataType(HttpRequest.RESPONSE_DATA_TYPE_OBJECT);
        //后台没数据临时
//        Type responseType = new TypeToken<List<CatalogueInfo>>() {
//        }.getType();
//        request.setResponseType(responseType);
        Type responseType = new TypeToken<List<Module>>() {
        }.getType();
        request.setResponseType(responseType);
        BaseRequestUtil.getInstance().add(request, tag);
        callBack.setUrl(request.getUrl());
    }


    /**
     * 学生根据考生用书ID获取布置作业章节记录
     *
     * @param brandId
     * @param serviceId
     * @param packageId
     * @param callBack
     */
    public static void getReceiveBookchapters(int brandId, int serviceId, String packageId, final BaseCallBack callBack) {
        Map<String, String> params = new HashMap<String, String>();
        params.put(HttpRequest.REQUEST_MODULES, EpaperAction.class.getName());
        params.put(HttpRequest.REQUEST_ACTION, EpaperAction.ACTION_GET_BOOKCHAPTERS);
        params.put("brandId", brandId + "");
        params.put("serviceId", serviceId + "");
        params.put("packageId", packageId + "");
        HttpRequest request = new HttpRequest(params,
                new Response.ErrorListener() {

                    @Override
                    public void onErrorResponse(VolleyError error) {
                        callBack.failed(error);
                    }

                }, new BaseRequest.ResponseCallback() {


            @Override
            public void error(int errorCode, String msg) {
                callBack.failed(errorCode, msg);
            }


            @Override
            public void success(Object obj, int resultCode,
                                int errorCode, String msg) {

                if (resultCode == 0 && errorCode == 0) {
                    callBack.success(obj);
                } else {
                    callBack.failed(errorCode, msg);
                }
            }


        });
        request.setResponseDataType(HttpRequest.RESPONSE_DATA_TYPE_OBJECT);
        Type responseType = new TypeToken<List<String>>() {
        }.getType();
        request.setResponseType(responseType);
        BaseRequestUtil.getInstance().add(request);
        callBack.setUrl(request.getUrl());

    }


    /**
     * 获取我的作业
     *
     * @param brandId  品牌ID
     * @param page     页码
     * @param pageSize 每页数量
     * @param workType 请求作业类型 0 全部；1未完成；2已完成
     * @param callBack 回调
     */
    public static void getMyWork(int brandId, int page, int pageSize, int workType, boolean isErrorWork,
                                 final BaseCallBack callBack) {
        Map<String, String> params = new HashMap<String, String>();
        params.put(HttpRequest.REQUEST_MODULES, EpaperAction.class.getName());
        if (isErrorWork) {
            params.put(HttpRequest.REQUEST_ACTION, EpaperAction.ACTION_GET_MY_ERROR_WORK);
        } else {
            if (DeviceUtil.isPad()) {
                params.put(HttpRequest.REQUEST_ACTION, EpaperAction.ACTION_GET_MY_WORK_PAD);
            } else {
                params.put(HttpRequest.REQUEST_ACTION, EpaperAction.ACTION_GET_MY_WORK);
            }
        }
        params.put("brandId", brandId + "");
        params.put("page", page + "");
        params.put("pageSize", pageSize + "");
        params.put("workType", workType + "");
        HttpRequest request = new HttpRequest(params,
                new Response.ErrorListener() {

                    @Override
                    public void onErrorResponse(VolleyError error) {
                        callBack.failed(error);
                    }

                }, new BaseRequest.ResponseCallback() {


            @Override
            public void error(int errorCode, String msg) {
                callBack.failed(errorCode, msg);
            }


            @Override
            public void success(Object obj, int resultCode,
                                int errorCode, String msg) {

                if (resultCode == 0 && errorCode == 0) {
                    callBack.success(obj);
                } else {
                    callBack.failed(errorCode, msg);
                }
            }


        });

        request.setResponseDataType(HttpRequest.RESPONSE_DATA_TYPE_OBJECT);
        Type responseType = new TypeToken<BasePaging<MyWork>>() {
        }.getType();
        request.setResponseType(responseType);
        BaseRequestUtil.getInstance().add(request);
        callBack.setUrl(request.getUrl());

    }

    public static void getmygrade(int brandId, String moduleIds,
                                  final BaseCallBack callBack) {
        Map<String, String> params = new HashMap<String, String>();
        params.put(HttpRequest.REQUEST_MODULES, EpaperAction.class.getName());
        params.put(HttpRequest.REQUEST_ACTION, EpaperAction.ACTION_GET_MY_GRADE);
        params.put("brandId", brandId + "");
        params.put("resourceTypes", moduleIds);

        HttpRequest request = new HttpRequest(params,
                new Response.ErrorListener() {

                    @Override
                    public void onErrorResponse(VolleyError error) {
                        callBack.failed(error);
                    }

                }, new BaseRequest.ResponseCallback() {


            @Override
            public void error(int errorCode, String msg) {
                callBack.failed(errorCode, msg);
            }


            @Override
            public void success(Object obj, int resultCode,
                                int errorCode, String msg) {

                if (resultCode == 0 && errorCode == 0) {
                    callBack.success(obj);
                } else {
                    callBack.failed(errorCode, msg);
                }
            }


        });

        request.setResponseDataType(HttpRequest.RESPONSE_DATA_TYPE_OBJECT);
        Type responseType = new TypeToken<List<MyGrade>>() {
        }.getType();

        request.setResponseType(responseType);
        BaseRequestUtil.getInstance().add(request);
        callBack.setUrl(request.getUrl());

    }


    /**
     * 获取zip 更新信息
     *
     * @param callBack 回调
     */
    public static void getZipPackageUpdateInfo(String appVersion,
                                               final BaseCallBack callBack) {
        Map<String, String> params = new HashMap<String, String>();
        params.put(HttpRequest.REQUEST_MODULES, EpaperAction.class.getName());
        params.put(HttpRequest.REQUEST_ACTION, EpaperAction.ACTION_GET_ZIP_PACKAGE_LIST);
        params.put("version", appVersion);
        HttpRequest request = new HttpRequest(params,
                new Response.ErrorListener() {

                    @Override
                    public void onErrorResponse(VolleyError error) {
                        callBack.failed(error);
                    }

                }, new BaseRequest.ResponseCallback() {


            @Override
            public void error(int errorCode, String msg) {
                callBack.failed(errorCode, msg);
            }

            @Override
            public void success(Object obj, int resultCode,
                                int errorCode, String msg) {

                if (resultCode == 0 && errorCode == 0) {
                    callBack.success(obj);
                } else {
                    callBack.failed(errorCode, msg);
                }
            }


        });

        request.setResponseDataType(HttpRequest.RESPONSE_DATA_TYPE_OBJECT);
        Type responseType = new TypeToken<List<ZipPackageInfo>>() {
        }.getType();

        request.setResponseType(responseType);
        BaseRequestUtil.getInstance().add(request);
        callBack.setUrl(request.getUrl());
    }


    /**
     * 获取报名活动广告栏信息
     *
     * @param brandId 品牌ID
     */
    public static void getAdverts(int brandId, long userId, final BaseCallBack callBack) {
        Map<String, String> params = new HashMap<>();
        params.put(HttpRequest.REQUEST_MODULES, EpaperAction.class.getName());
        params.put(HttpRequest.REQUEST_ACTION, EpaperAction.ACTION_GET_ADVERT);
        params.put("brandId", brandId + "");
        params.put("userId", userId + "");
        HttpRequest request = new HttpRequest(params,
                new Response.ErrorListener() {

                    @Override
                    public void onErrorResponse(VolleyError error) {
                        callBack.failed(error);
                    }

                }, new BaseRequest.ResponseCallback() {

            @Override
            public void error(int errorCode, String msg) {
                callBack.failed(errorCode, msg);
            }

            @Override
            public void success(Object obj, int resultCode,
                                int errorCode, String msg) {

                if (resultCode == 0 && errorCode == 0) {
                    callBack.success(obj);
                } else {
                    callBack.failed(errorCode, msg);
                }
            }
        });

        request.setResponseDataType(HttpRequest.RESPONSE_DATA_TYPE_OBJECT);
        request.setResponseClazz(PlanBean.class);
        BaseRequestUtil.getInstance().add(request);
        callBack.setUrl(request.getUrl());
    }


    /**
     * 作业通知回执
     *
     * @param workIds
     * @param callBack
     */
    public static void setWorkNotifyRead(String workIds,
                                         final BaseCallBack callBack) {
        Map<String, String> params = new HashMap<String, String>();
        params.put(HttpRequest.REQUEST_MODULES, EpaperAction.class.getName());
        params.put(HttpRequest.REQUEST_ACTION,
                EpaperAction.ACTION_GET_SET_READ);
        params.put("workIds", workIds + "");
        HttpRequest request = new HttpRequest(params,
                new Response.ErrorListener() {

                    @Override
                    public void onErrorResponse(VolleyError error) {
                        callBack.failed(error);
                    }
                }, new BaseRequest.ResponseCallback() {

            @Override
            public void error(int errorCode, String msg) {
                callBack.failed(errorCode, msg);
            }

            @Override
            public void success(Object obj, int resultCode,
                                int errorCode, String msg) {
                if (resultCode == 0 && errorCode == 0) {
                    callBack.success(obj);
                } else {
                    callBack.failed(errorCode, msg);
                }
            }
        });
        request.setResponseDataType(HttpRequest.RESPONSE_DATA_TYPE_OBJECT);
        request.setResponseClazz(Boolean.class);
        BaseRequestUtil.getInstance().add(request);
        callBack.setUrl(request.getUrl());
    }


    /**
     * 提交作业答案
     *
     * @param oldJson  答案json
     * @param callBack 回调
     */

    public static void submit(final String oldJson, int workType, final String workId, Class clazz, final BaseCallBack callBack) {
        Map<String, String> params = new HashMap<String, String>();
        params.put(HttpRequest.REQUEST_MODULES, EpaperAction.class.getName());
        if (workType == 1) {
            params.put(HttpRequest.REQUEST_ACTION, EpaperAction.ACTION_SUBMIT_ERROR_WORKS);
        } else {
            params.put(HttpRequest.REQUEST_ACTION, EpaperAction.ACTION_SUBMIT_WORKS);
        }
        String sign = DeviceUtil.hmacSha1(oldJson, EConstants.HMACSHA1_SECRECT);
        params.put("sign", sign);
        JSONObject jsonObject = new JSONObject();
        try {
            jsonObject.put("data", oldJson);
        } catch (JSONException e) {
            e.printStackTrace();
        }
        final String json = jsonObject.toString();
        HeadOverrideRequest request = new HeadOverrideRequest(Request.Method.POST, params,
                new Response.ErrorListener() {

                    @Override
                    public void onErrorResponse(VolleyError error) {
                        callBack.failed(error);
                    }
                }, new BaseRequest.ResponseCallback() {

            @Override
            public void error(int errorCode, String msg) {
                callBack.failed(errorCode, msg);
                String logDesc = "习网服务器提交答案失败  " + json;
                String remark = "workId==" + workId + "; errorCOde==" + errorCode + " ; msg==" + msg;
                FeedbackUtil.getInstance().addFeedbackLog(FeedbackUtil.FEEDBACK_TYPE_SUBMIT_WORK, logDesc, remark);
            }

            @Override
            public void success(Object obj, int resultCode, int errorCode, String msg) {
                if (resultCode == 0 && errorCode == 0) {
                    if (null != callBack)
                        callBack.success(obj);
                } else {
                    if (null != callBack) {
                        callBack.failed(errorCode, msg);

                        String logDesc = "习网服务器提交答案失败  " + json;
                        String remark = "workId==" + workId + "; errorCOde==" + errorCode + " ; msg==" + msg;
                        FeedbackUtil.getInstance().addFeedbackLog(FeedbackUtil.FEEDBACK_TYPE_SUBMIT_WORK, logDesc, remark);
                    }
                }
            }
        }) {
            @Override
            public byte[] getBody() throws AuthFailureError {
                return json.getBytes();
            }
        };
        request.setResponseDataType(HttpRequest.RESPONSE_DATA_TYPE_OBJECT);
        request.setResponseClazz(clazz);
        BaseRequestUtil.getInstance().add(request, "" + workId);
        callBack.setUrl(request.getUrl());
    }

    /**
     * 提交作业答案
     *
     * @param oldJson  答案json
     * @param callBack 回调
     */

    public static void submitDubingVideo(final String oldJson, int workType, final String workId, Class clazz, final BaseCallBack callBack) {
        Map<String, String> params = new HashMap<String, String>();
        params.put(HttpRequest.REQUEST_MODULES, EpaperAction.class.getName());
        params.put(HttpRequest.REQUEST_ACTION, EpaperAction.ACTION_SUBMIT_VIDEO_WORKS);
        String sign = DeviceUtil.hmacSha1(oldJson, EConstants.HMACSHA1_SECRECT);
        params.put("sign", sign);
        JSONObject jsonObject = new JSONObject();
        try {
            jsonObject.put("data", oldJson);
        } catch (JSONException e) {
            e.printStackTrace();
        }
        final String json = jsonObject.toString();
        HeadOverrideRequest request = new HeadOverrideRequest(Request.Method.POST, params,
                new Response.ErrorListener() {

                    @Override
                    public void onErrorResponse(VolleyError error) {
                        callBack.failed(error);
                    }
                }, new BaseRequest.ResponseCallback() {

            @Override
            public void error(int errorCode, String msg) {
                callBack.failed(errorCode, msg);
                String logDesc = "习网服务器提交答案失败  " + json;
                String remark = "workId==" + workId + "; errorCOde==" + errorCode + " ; msg==" + msg;
                FeedbackUtil.getInstance().addFeedbackLog(FeedbackUtil.FEEDBACK_TYPE_SUBMIT_WORK, logDesc, remark);
            }

            @Override
            public void success(Object obj, int resultCode, int errorCode, String msg) {
                if (resultCode == 0 && errorCode == 0) {
                    if (null != callBack)
                        callBack.success(obj);
                } else {
                    if (null != callBack) {
                        callBack.failed(errorCode, msg);

                        String logDesc = "习网服务器提交答案失败  " + json;
                        String remark = "workId==" + workId + "; errorCOde==" + errorCode + " ; msg==" + msg;
                        FeedbackUtil.getInstance().addFeedbackLog(FeedbackUtil.FEEDBACK_TYPE_SUBMIT_WORK, logDesc, remark);
                    }
                }
            }
        }) {
            @Override
            public byte[] getBody() throws AuthFailureError {
                return json.getBytes();
            }
        };
        request.setResponseDataType(HttpRequest.RESPONSE_DATA_TYPE_OBJECT);
        request.setResponseClazz(clazz);
        BaseRequestUtil.getInstance().add(request, "" + workId);
        callBack.setUrl(request.getUrl());
    }

    /**
     * 查询分数借口  听说模考 线上做答
     *
     * @param callBack 回调
     */
    public static void getOnlineScore(final String doWorkId,
                                      final BaseCallBack callBack) {

        Map<String, String> params = new HashMap<String, String>();
        params.put(HttpRequest.REQUEST_MODULES, EpaperAction.class.getName());
        params.put(HttpRequest.REQUEST_ACTION,
                EpaperAction.ACTION_GET_SCORE_OF_ONLINE);
        params.put("doWorkId", doWorkId);


        HttpRequest request = new HttpRequest(params,
                new Response.ErrorListener() {

                    @Override
                    public void onErrorResponse(VolleyError error) {
                        callBack.failed(error);
                    }
                }, new BaseRequest.ResponseCallback() {

            @Override
            public void error(int errorCode, String msg) {
                callBack.failed(errorCode, msg);
            }

            @Override
            public void success(Object obj, int resultCode,
                                int errorCode, String msg) {
                if (resultCode == 0 && errorCode == 0) {
                    callBack.success(obj);
                } else {
                    callBack.failed(errorCode, msg);
                }
            }
        });
        request.setResponseDataType(HttpRequest.RESPONSE_DATA_TYPE_OBJECT);
        request.setResponseClazz(Result_scoce.class);
        BaseRequestUtil.getInstance().add(request);
        callBack.setUrl(request.getUrl());

    }

    /**
     * 更新提交过的单元测试作业
     *
     * @param doWorkId 做作业ID
     * @param callBack 回调
     */
    public static void updateUnitTestWork(final String doWorkId,
                                          final BaseCallBack callBack) {
        Map<String, String> params = new HashMap<String, String>();
        params.put(HttpRequest.REQUEST_MODULES, EpaperAction.class.getName());
        params.put(HttpRequest.REQUEST_ACTION,
                EpaperAction.ACTION_UPDATE_UNIT_TEST_WORKS);
        params.put("doWorkId", doWorkId);
        HttpRequest request = new HttpRequest(params,
                new Response.ErrorListener() {

                    @Override
                    public void onErrorResponse(VolleyError error) {
                        callBack.failed(error);
                    }
                }, new BaseRequest.ResponseCallback() {

            @Override
            public void error(int errorCode, String msg) {
                callBack.failed(errorCode, msg);
            }

            @Override
            public void success(Object obj, int resultCode,
                                int errorCode, String msg) {
                if (resultCode == 0 && errorCode == 0) {
                    callBack.success(obj);
                } else {
                    callBack.failed(errorCode, msg);
                }
            }
        }) {
        };
        request.setResponseDataType(HttpRequest.RESPONSE_DATA_TYPE_OBJECT);
        request.setResponseClazz(String.class);
        BaseRequestUtil.getInstance().add(request);
        callBack.setUrl(request.getUrl());
    }

    /**
     * 添加书籍到书柜记录
     *
     * @param brandId
     * @param productId
     * @param callBack
     */
    public static void setBookcaseToServer(int brandId, String productId, int serviceId, final BaseCallBack callBack) {
        Map<String, String> params = new HashMap<String, String>();
        params.put(HttpRequest.REQUEST_MODULES, EpaperAction.class.getName());
        params.put(HttpRequest.REQUEST_ACTION,
                EpaperAction.ACTION_SET_EPAGE_BOOKCASE);
        params.put("brandId", brandId + "");
        params.put("productId", productId);
        params.put("serviceId", serviceId + "");
        HttpRequest request = new HttpRequest(params,
                new Response.ErrorListener() {

                    @Override
                    public void onErrorResponse(VolleyError error) {
                        callBack.failed(error);
                    }
                }, new BaseRequest.ResponseCallback() {

            @Override
            public void error(int errorCode, String msg) {
                callBack.failed(errorCode, msg);
            }

            @Override
            public void success(Object obj, int resultCode,
                                int errorCode, String msg) {
                if (resultCode == 0 && errorCode == 0) {
                    callBack.success(obj);
                } else {
                    callBack.failed(errorCode, msg);
                }
            }
        });
        request.setResponseDataType(HttpRequest.RESPONSE_DATA_TYPE_OBJECT);
        //request.setResponseClazz(String.class);
        BaseRequestUtil.getInstance().add(request);
        callBack.setUrl(request.getUrl());

    }


    /**
     * 删除书柜记录By书箱ID
     *
     * @param brandId
     * @param productId
     * @param callBack
     */
    public static void setDelBookcaseToServer(int brandId, String productId, int serviceId, final BaseCallBack callBack) {
        Map<String, String> params = new HashMap<String, String>();
        params.put(HttpRequest.REQUEST_MODULES, EpaperAction.class.getName());
        params.put(HttpRequest.REQUEST_ACTION,
                EpaperAction.ACTION_DEL_EPAGE_BOOKCASE);
        params.put("brandId", brandId + "");

        params.put("productId", productId);
        params.put("serviceId", serviceId + "");
//        params.put("deletePara", "{["",""],["",""]}");


        HttpRequest request = new HttpRequest(params,
                new Response.ErrorListener() {

                    @Override
                    public void onErrorResponse(VolleyError error) {
                        callBack.failed(error);
                    }
                }, new BaseRequest.ResponseCallback() {

            @Override
            public void error(int errorCode, String msg) {
                callBack.failed(errorCode, msg);
            }

            @Override
            public void success(Object obj, int resultCode,
                                int errorCode, String msg) {
                if (resultCode == 0 && errorCode == 0) {
                    callBack.success(obj);
                } else {
                    callBack.failed(errorCode, msg);
                }
            }
        });
        request.setResponseDataType(HttpRequest.RESPONSE_DATA_TYPE_OBJECT);
        //request.setResponseClazz(String.class);
        BaseRequestUtil.getInstance().add(request);
        callBack.setUrl(request.getUrl());

    }


    /**
     * 删除书柜记录By书箱ID
     *
     * @param brandId
     * @param callBack
     */
    public static void setDelBookcaseToServerByList(int brandId, ArrayList<DeleteEP> deleteEPList, final BaseCallBack callBack) {

        Map<String, String> params = new HashMap<String, String>();
        params.put(HttpRequest.REQUEST_MODULES, EpaperAction.class.getName());
        params.put(HttpRequest.REQUEST_ACTION, EpaperAction.ACTION_DEL_EPAGE_BOOKCASE_LIST);

        DeleteEpInfo deleteEpInfo = new DeleteEpInfo();
        deleteEpInfo.setBrandId(brandId);
        Gson gson = new Gson();
        Type responseType;
        responseType = new TypeToken<List<DeleteEP>>() {
        }.getType();
        String deleteJson = gson.toJson(deleteEPList, responseType);
        deleteEpInfo.setDelParam(deleteJson);
        String json = new Gson().toJson(deleteEpInfo, DeleteEpInfo.class);
        Log.d("EpaperFragment", "####deleteJson#########" + deleteJson);

        try {
            JSONObject jsonObject = new JSONObject(json);
            String key = "delParam";
            if (jsonObject.has(key)) {
                JSONArray array = new JSONArray(deleteEpInfo.getDelParam());
                jsonObject.remove(key);
                jsonObject.put(key, array);
                json = jsonObject.toString();
            }
            Log.d("EpaperFragment", "####json#########" + json);
        } catch (Exception e) {
            if (e != null) {
                Log.d("EpaperFragment", "############e#############" + e.getMessage());
            }
        }

        final String commitJson = json;


        HeadOverrideRequest request = new HeadOverrideRequest(Request.Method.POST, params,
                new Response.ErrorListener() {

                    @Override
                    public void onErrorResponse(VolleyError error) {
                        callBack.failed(error);
                    }
                }, new BaseRequest.ResponseCallback() {

            @Override
            public void error(int errorCode, String msg) {
                callBack.failed(errorCode, msg);
            }

            @Override
            public void success(Object obj, int resultCode,
                                int errorCode, String msg) {
                if (resultCode == 0 && errorCode == 0) {
                    callBack.success(obj);
                } else {
                    callBack.failed(errorCode, msg);
                }
            }
        }) {
            @Override
            public byte[] getBody() throws AuthFailureError {
                return commitJson.getBytes();
            }
        };
        request.setResponseDataType(HttpRequest.RESPONSE_DATA_TYPE_OBJECT);
        //request.setResponseClazz(String.class);
        BaseRequestUtil.getInstance().add(request);
        callBack.setUrl(request.getUrl());

    }


    /**
     * 获取视频讲解答案
     *
     * @param callBack 回调
     */
    public static void getVideoExplainAnswer(String doWorkId, int requestType,
                                             final BaseCallBack callBack) {
        Map<String, String> params = new HashMap<String, String>();
        params.put(HttpRequest.REQUEST_MODULES, EpaperAction.class.getName());
        params.put(HttpRequest.REQUEST_ACTION, EpaperAction.ACTION_GET_VIDEO_EXPLAN_ANSWER);
//        params.put("brandId", brandId + "");
        params.put("doWorkId", doWorkId + "");
//        params.put("packageId", packageId + "");
//        params.put("cid", cid + "");
//        params.put("resourceType", resourceType + "");

        HttpRequest request = new HttpRequest(params,
                new Response.ErrorListener() {

                    @Override
                    public void onErrorResponse(VolleyError error) {
                        callBack.failed(error);
                    }
                }, new BaseRequest.ResponseCallback() {

            @Override
            public void error(int errorCode, String msg) {
                callBack.failed(errorCode, msg);
            }

            @Override
            public void success(Object obj, int resultCode,
                                int errorCode, String msg) {

                if (resultCode == 0 && errorCode == 0) {
                    callBack.success(obj);
                } else {
                    callBack.failed(errorCode, msg);
                }
            }
        });

        request.setResponseDataType(HttpRequest.RESPONSE_DATA_TYPE_OBJECT);
        Type responseType;
        if (requestType == EpaperConstant.H5_JUMP_TYPE_ONLINE_ANSWER) {
            responseType = new TypeToken<List<TempWorkAnswers>>() {
            }.getType();

        } else {

            responseType = new TypeToken<List<VideoExplainWorkAnswers>>() {
            }.getType();

        }


        request.setResponseType(responseType);
        BaseRequestUtil.getInstance().add(request);
        callBack.setUrl(request.getUrl());

    }

    /**
     * 获取在线作答答案
     *
     * @param callBack 回调
     */
    public static void getOnlineAnswer(String doWorkId, final BaseCallBack callBack) {
        Map<String, String> params = new HashMap<String, String>();
        params.put(HttpRequest.REQUEST_MODULES, EpaperAction.class.getName());
        params.put(HttpRequest.REQUEST_ACTION, EpaperAction.ACTION_GET_VIDEO_EXPLAN_ANSWER);
        params.put("doWorkId", doWorkId + "");

        HttpRequest request = new HttpRequest(params,
                new Response.ErrorListener() {

                    @Override
                    public void onErrorResponse(VolleyError error) {
                        callBack.failed(error);
                    }
                }, new BaseRequest.ResponseCallback() {

            @Override
            public void error(int errorCode, String msg) {
                callBack.failed(errorCode, msg);
            }

            @Override
            public void success(Object obj, int resultCode, int errorCode, String msg) {

                if (resultCode == 0 && errorCode == 0) {
                    callBack.success(obj);
                } else {
                    callBack.failed(errorCode, msg);
                }
            }
        });

        request.setResponseDataType(HttpRequest.RESPONSE_DATA_TYPE_OBJECT);
        Type responseType = new TypeToken<List<TempWorkAnswers>>() {
        }.getType();
        request.setResponseType(responseType);
        BaseRequestUtil.getInstance().add(request);
        callBack.setUrl(request.getUrl());

    }

    /**
     * 检查权限
     *
     * @param brandId       品牌ID（商家ID）
     * @param serviceTypeId 服务ID （可单独参数）
     * @param goodsId       书本ID（可单独参数）
     * @param chapterId     书本目录ID（可单独参数）(后期添加)
     * @param quesId        问题id
     * @param letv          视频编号
     */
    public static void checkValid(String brandId, String serviceTypeId, String goodsId, String chapterId, String quesId, String letv, BaseCallBack baseCallBack) {
        checkValid(brandId, serviceTypeId, goodsId, chapterId, quesId, letv, 0, baseCallBack);
    }

    /**
     * 检查权限
     *
     * @param brandId       品牌ID（商家ID）
     * @param serviceTypeId 服务ID （可单独参数）
     * @param goodsId       书本ID（可单独参数）
     * @param chapterId     书本目录ID（可单独参数）(后期添加)
     * @param quesId        问题id
     * @param letv          视频编号
     */
    public static void checkValid(String brandId, String serviceTypeId, String goodsId, String chapterId, String quesId, String letv, int workType, final BaseCallBack baseCallBack) {
        Map<String, String> params = new HashMap<String, String>();
        params.put(HttpRequest.REQUEST_MODULES, EpaperAction.class.getName());
        params.put(HttpRequest.REQUEST_ACTION, EpaperAction.ACTION_CHECKVALID);
        params.put("brandId", brandId + "");
        params.put("workType", workType + "");
        if (!TextUtils.isEmpty(serviceTypeId)) {
            params.put("serviceTypeId", serviceTypeId + "");
        }
        if (!TextUtils.isEmpty(goodsId)) {
            params.put("goodsId", goodsId + "");
        }
        if (!TextUtils.isEmpty(quesId)) {
            params.put("quesId", quesId + "");
        }
        if (!TextUtils.isEmpty(letv)) {
            params.put("letv", letv + "");
        }
        if (!TextUtils.isEmpty(chapterId) && null != chapterId) {
            params.put("chapterId", chapterId + "");
        }
        HttpRequest httpRequest = new HttpRequest(params, new Response.ErrorListener() {

            @Override
            public void onErrorResponse(VolleyError volleyError) {
                baseCallBack.failed(volleyError);
            }
        }, new BaseRequest.ResponseCallback() {
            @Override
            public void error(int errorCode, String msg) {
                baseCallBack.failed(errorCode, msg);
                super.error(errorCode, msg);
            }

            @Override
            public void success(Object obj, int resultCode, int errorCode, String msg) {
                if (resultCode == 0 && errorCode == 0) {
                    baseCallBack.success(obj);
                } else {
                    baseCallBack.failed(errorCode, msg);
                }
            }
        });
        httpRequest.setResponseDataType(HttpRequest.RESPONSE_DATA_TYPE_OBJECT);
        Type responseType = new TypeToken<CheckValidBean>() {
        }.getType();
        httpRequest.setResponseType(responseType);
        BaseRequestUtil.getInstance().add(httpRequest);
        baseCallBack.setUrl(httpRequest.getUrl());
    }

    public static void getServicesList(String brandId, final BaseCallBack baseCallBack) {
        Map<String, String> params = new HashMap<>();
        params.put(HttpRequest.REQUEST_MODULES, EpaperAction.class.getName());
        params.put(HttpRequest.REQUEST_ACTION, EpaperAction.ACTION_USER_SERVICES);
        params.put("brandId", brandId + "");
        HttpRequest httpRequest = new HttpRequest(params, new Response.ErrorListener() {
            @Override
            public void onErrorResponse(VolleyError volleyError) {
                baseCallBack.failed(volleyError);
            }
        }, new BaseRequest.ResponseCallback() {

            @Override
            public void success(Object obj, int resultCode, int errorCode, String msg) {
                if (resultCode == 0 && errorCode == 0) {
                    baseCallBack.success(obj);
                } else {
                    baseCallBack.failed(errorCode, msg);
                }
            }

            @Override
            public void error(int errorCode, String msg) {
                baseCallBack.failed(errorCode, msg);
                super.error(errorCode, msg);
            }
        });
        httpRequest.setResponseDataType(HttpRequest.RESPONSE_DATA_TYPE_OBJECT);
        Type responseType = new TypeToken<List<EpaperInfo.Server>>() {
        }.getType();
        httpRequest.setResponseType(responseType);
        BaseRequestUtil.getInstance().add(httpRequest);
        baseCallBack.setUrl(httpRequest.getUrl());

    }

    public static void getUserProductByKey(String brandId, String grade, String serviceId, String keyWords, int pageIndex, int pageSize, final BaseCallBack baseCallBack) {
        Map<String, String> params = new HashMap<>();
        params.put(HttpRequest.REQUEST_MODULES, EpaperAction.class.getName());
        params.put(HttpRequest.REQUEST_ACTION, EpaperAction.GET_USER_PRODUCT_BY_KEY);
        params.put("brandId", brandId + "");
        params.put("grade", grade);
        params.put("serviceId", serviceId);
        params.put("keyWords", keyWords);
        params.put("pageIndex", pageIndex + "");
        params.put("pageSize", pageSize + "");
        HttpRequest httpRequest = new HttpRequest(params, new Response.ErrorListener() {
            @Override
            public void onErrorResponse(VolleyError volleyError) {
                baseCallBack.failed(volleyError);
            }
        }, new BaseRequest.ResponseCallback() {

            @Override
            public void success(Object obj, int resultCode, int errorCode, String msg) {
                if (resultCode == 0 && errorCode == 0) {
                    baseCallBack.success(obj);
                } else {
                    baseCallBack.failed(errorCode, msg);
                }
            }

            @Override
            public void error(int errorCode, String msg) {
                baseCallBack.failed(errorCode, msg);
                super.error(errorCode, msg);
            }
        });
        httpRequest.setResponseDataType(HttpRequest.RESPONSE_DATA_TYPE_OBJECT);
        Type responseType = new TypeToken<BookCaseBean>() {
        }.getType();
        httpRequest.setResponseType(responseType);
        BaseRequestUtil.getInstance().add(httpRequest);
        baseCallBack.setUrl(httpRequest.getUrl());

    }


    public static void getBookKey(String brandId, String schoolId, final BaseCallBack baseCallBack) {
        Map<String, String> params = new HashMap<>();
        params.put(HttpRequest.REQUEST_MODULES, EpaperAction.class.getName());
        params.put(HttpRequest.REQUEST_ACTION, EpaperAction.GET_BOOK_KEY);
        params.put("brandId", brandId + "");
        params.put("schoolId", schoolId + "");
        HttpRequest httpRequest = new HttpRequest(params, new Response.ErrorListener() {
            @Override
            public void onErrorResponse(VolleyError volleyError) {
                baseCallBack.failed(volleyError);
            }
        }, new BaseRequest.ResponseCallback() {

            @Override
            public void success(Object obj, int resultCode, int errorCode, String msg) {
                if (resultCode == 0 && errorCode == 0) {
                    baseCallBack.success(obj);
                } else {
                    baseCallBack.failed(errorCode, msg);
                }
            }

            @Override
            public void error(int errorCode, String msg) {
                baseCallBack.failed(errorCode, msg);
                super.error(errorCode, msg);
            }
        });
        httpRequest.setResponseDataType(HttpRequest.RESPONSE_DATA_TYPE_OBJECT);
        Type responseType = new TypeToken<List<SearchBookKeyNameBean>>() {
        }.getType();
        httpRequest.setResponseType(responseType);
        BaseRequestUtil.getInstance().add(httpRequest);
        baseCallBack.setUrl(httpRequest.getUrl());

    }


    public static void getBookOrServiceList(int brandId, int page, int pageSize, int schoolId, int gradeId,
                                            int subjectId, int salesType, String area, String keyWords, final BaseCallBack baseCallBack) {
        Map<String, String> params = new HashMap<>();
        params.put(HttpRequest.REQUEST_MODULES, EpaperAction.class.getName());
        params.put(HttpRequest.REQUEST_ACTION, EpaperAction.ACTION_SEARCH_BOOK_AND_SERVICE);


        params.put("brandId", brandId + "");
        params.put("schoolId", schoolId + "");
        params.put("gradeId", gradeId + "");
        params.put("subjectId", subjectId + "");
        params.put("salesType", salesType + "");
        params.put("area", area + "");
        params.put("pIndex", page + "");
        params.put("psize", pageSize + "");

        if (!TextUtils.isEmpty(keyWords)) {
            params.put("keyWords", keyWords + "");
        }


        HttpRequest httpRequest = new HttpRequest(params, new Response.ErrorListener() {
            @Override
            public void onErrorResponse(VolleyError volleyError) {
                baseCallBack.failed(volleyError);
            }
        }, new BaseRequest.ResponseCallback() {

            @Override
            public void success(Object obj, int resultCode, int errorCode, String msg) {
                if (resultCode == 0 && errorCode == 0) {
                    baseCallBack.success(obj);
                } else {
                    baseCallBack.failed(errorCode, msg);
                }
            }

            @Override
            public void error(int errorCode, String msg) {
                baseCallBack.failed(errorCode, msg);
                super.error(errorCode, msg);
            }
        });
        httpRequest.setResponseDataType(HttpRequest.RESPONSE_DATA_TYPE_OBJECT);
        Type responseType = new TypeToken<BasePaging<NewBook>>() {
        }.getType();
        httpRequest.setResponseType(responseType);
        BaseRequestUtil.getInstance().add(httpRequest);
        baseCallBack.setUrl(httpRequest.getUrl());

    }


    public static void getBookOrServiceListByType(int brandId, int applyType, int page, int pageSize, int schoolId, int gradeId, int subjectId, String area, final BaseCallBack baseCallBack) {
        Map<String, String> params = new HashMap<>();
        params.put(HttpRequest.REQUEST_MODULES, EpaperAction.class.getName());
        params.put(HttpRequest.REQUEST_ACTION, EpaperAction.ACTION_SEARCH_BOOK_AND_SERVICE_BY_TYPE);


        params.put("brandId", brandId + "");
        params.put("applyType", applyType + "");

        if (!TextUtils.isEmpty(area)) {
            params.put("area", area + "");
        }


        params.put("gradeId", gradeId + "");
        params.put("subjectId", subjectId + "");
        params.put("schoolId", schoolId + "");

        params.put("pIndex", page + "");
        params.put("psize", pageSize + "");


        HttpRequest httpRequest = new HttpRequest(params,
                new Response.ErrorListener() {
                    @Override
                    public void onErrorResponse(VolleyError volleyError) {
                        baseCallBack.failed(volleyError);
                    }
                }, new BaseRequest.ResponseCallback() {

            @Override
            public void success(Object obj, int resultCode, int errorCode, String msg) {
                if (resultCode == 0 && errorCode == 0) {
                    baseCallBack.success(obj);
                    CWLog.d("setResponseDataType####", obj + "");
                    CWLog.d("setResponseDataType$####222", obj.toString() + "");
                } else {
                    baseCallBack.failed(errorCode, msg);
                }
            }

            @Override
            public void error(int errorCode, String msg) {
                baseCallBack.failed(errorCode, msg);
                super.error(errorCode, msg);
            }
        });
       /* if (applyType==5){
            httpRequest.setResponseDataType(HttpRequest.RESPONSE_DATA_TYPE_STRING);
        }else {
            httpRequest.setResponseDataType(HttpRequest.RESPONSE_DATA_TYPE_OBJECT);
        }*/
        httpRequest.setResponseDataType(HttpRequest.RESPONSE_DATA_TYPE_OBJECT);
        Type responseType = new TypeToken<BasePaging<NewBook>>() {
        }.getType();
        httpRequest.setResponseType(responseType);
        BaseRequestUtil.getInstance().add(httpRequest);
        baseCallBack.setUrl(httpRequest.getUrl());

    }

    public static void getSubjectListByGrade(int brandId, int gradeId, int salesType, String area, int schoolId, int applyType,
                                             final BaseCallBack callBack) {
        Map<String, String> params = new HashMap<String, String>();
        params.put(HttpRequest.REQUEST_MODULES, EpaperAction.class.getName());
        params.put(HttpRequest.REQUEST_ACTION, EpaperAction.ACTION_GET_SUBJECT_LIST);
        params.put("gradeId", gradeId + "");
        params.put("brandId", brandId + "");
        params.put("salesType", salesType + "");
        params.put("area", area + "");
        params.put("schoolId", schoolId + "");
        params.put("applyType", applyType + "");

        HttpRequest request = new HttpRequest(params,
                new Response.ErrorListener() {
                    @Override
                    public void onErrorResponse(VolleyError volleyError) {
                        callBack.failed(volleyError);
                    }
                }, new BaseRequest.ResponseCallback() {
            @Override
            public void error(int errorCode, String msg) {
                callBack.failed(errorCode, msg);
            }

            @Override
            public void success(Object obj, int resultCode,
                                int errorCode, String msg) {
                if (resultCode == 0 && errorCode == 0) {
                    callBack.success(obj);
                } else {
                    callBack.failed(errorCode, msg);
                }
            }
        });
        request.setResponseDataType(HttpRequest.RESPONSE_DATA_TYPE_OBJECT);
        Type responseType = new TypeToken<List<Subject>>() {
        }.getType();
        request.setResponseType(responseType);
        BaseRequestUtil.getInstance().add(request);
        callBack.setUrl(request.getUrl());

    }


    /**
     * 根据品牌ID获取自主学习书籍
     *
     * @param brandId
     * @param callBack
     */
    public static void getAutonomicStudyBooks(int brandId, final BaseCallBack callBack) {
        Map<String, String> params = new HashMap<String, String>();
        params.put(HttpRequest.REQUEST_MODULES, EpaperAction.class.getName());
        params.put(HttpRequest.REQUEST_ACTION,
                EpaperAction.ACTION_GET_AUTONMONIC_STUDY_BOOKS);
        params.put("brandId", brandId + "");

        HttpRequest request = new HttpRequest(params,
                new Response.ErrorListener() {

                    @Override
                    public void onErrorResponse(VolleyError error) {
                        callBack.failed(error);
                    }
                }, new BaseRequest.ResponseCallback() {

            @Override
            public void error(int errorCode, String msg) {
                callBack.failed(errorCode, msg);
            }

            @Override
            public void success(Object obj, int resultCode,
                                int errorCode, String msg) {
                if (resultCode == 0 && errorCode == 0) {
                    callBack.success(obj);
                } else {
                    callBack.failed(errorCode, msg);
                }
            }
        });
        request.setResponseDataType(HttpRequest.RESPONSE_DATA_TYPE_OBJECT);
        Type responseType = new TypeToken<List<EpaperInfo>>() {
        }.getType();
        request.setResponseType(responseType);
        BaseRequestUtil.getInstance().add(request);
        callBack.setUrl(request.getUrl());

    }

    /**
     * 根据标签查询书籍列表
     *
     * @param brandId
     * @param
     */
    public static void getproductsbybookmark(int brandId, int bookmarkId, int pageIndex, int pageSize,
                                             final BaseCallBack callBack) {
        Map<String, String> params = new HashMap<String, String>();
        params.put(HttpRequest.REQUEST_MODULES, EpaperAction.class.getName());
        params.put(HttpRequest.REQUEST_ACTION,
                EpaperAction.ACTION_GET__PRODUCTS_BY_BOOKMARK);
        params.put("brandId", brandId + "");
        params.put("bookmarkId", bookmarkId + "");
        params.put("pageIndex", pageIndex + "");
        params.put("pageSize", pageSize + "");

        HttpRequest request = new HttpRequest(params,
                new Response.ErrorListener() {

                    @Override
                    public void onErrorResponse(VolleyError error) {
                        callBack.failed(error);
                    }
                }, new BaseRequest.ResponseCallback() {

            @Override
            public void error(int errorCode, String msg) {
                callBack.failed(errorCode, msg);
            }

            @Override
            public void success(Object obj, int resultCode,
                                int errorCode, String msg) {
                if (resultCode == 0 && errorCode == 0) {
                    callBack.success(obj);
                } else {
                    callBack.failed(errorCode, msg);
                }
            }
        });
        request.setResponseDataType(HttpRequest.RESPONSE_DATA_TYPE_OBJECT);
        Type responseType = new TypeToken<BookMarkPageInfo>() {
        }.getType();
        request.setResponseType(responseType);
        BaseRequestUtil.getInstance().add(request);
        callBack.setUrl(request.getUrl());

    }

    //0,置顶，1，取消置顶
    public static void setHeadLastBooks(String productId, int serviceId, int userId, int action, final BaseCallBack callBack) {
        try {
            Map<String, String> params = new HashMap<String, String>();
            params.put(HttpRequest.REQUEST_MODULES, EpaperAction.class.getName());
            params.put(HttpRequest.REQUEST_ACTION,
                    EpaperAction.ACTION_GET_SET_HEAD_LASTBOOKS);
            params.put("productId", productId + "");
            params.put("serviceId", serviceId + "");
            params.put("userId", userId + "");
            params.put("action", action + "");

            HttpRequest request = new HttpRequest(params,
                    new Response.ErrorListener() {

                        @Override
                        public void onErrorResponse(VolleyError error) {
                            callBack.failed(error);
                        }
                    }, new BaseRequest.ResponseCallback() {

                @Override
                public void error(int errorCode, String msg) {
                    callBack.failed(errorCode, msg);
                }

                @Override
                public void success(Object obj, int resultCode,
                                    int errorCode, String msg) {
                    if (resultCode == 0 && errorCode == 0) {
                        callBack.success(obj);
                    } else {
                        callBack.failed(errorCode, msg);
                    }
                }
            });
            request.setResponseDataType(HttpRequest.RESPONSE_DATA_TYPE_OBJECT);
            Type responseType = new TypeToken<EpaperInfo>() {
            }.getType();
            request.setResponseType(responseType);
            BaseRequestUtil.getInstance().add(request);
            callBack.setUrl(request.getUrl());
        } catch (Exception e) {
            e.getStackTrace();
        }

    }

    public static void getBookDeskHomePage(int brandId, int gradeId, final BaseCallBack callBack) {
        Map<String, String> params = new HashMap<String, String>();
        params.put(HttpRequest.REQUEST_MODULES, EpaperAction.class.getName());
        params.put(HttpRequest.REQUEST_ACTION,
                EpaperAction.ACTION_GET_USER_DESK_HEAD);
        params.put("brandId", brandId + "");
        params.put("gradeId", gradeId + "");
//        params.put("gradeId", "9999");
        HttpRequest request = new HttpRequest(params,
                new Response.ErrorListener() {

                    @Override
                    public void onErrorResponse(VolleyError error) {
                        callBack.failed(error);
                    }
                }, new BaseRequest.ResponseCallback() {

            @Override
            public void error(int errorCode, String msg) {
                callBack.failed(errorCode, msg);
            }

            @Override
            public void success(Object obj, int resultCode,
                                int errorCode, String msg) {
                if (resultCode == 0 && errorCode == 0) {
                    callBack.success(obj);
                } else {
                    callBack.failed(errorCode, msg);
                }
            }
        });
        request.setResponseDataType(HttpRequest.RESPONSE_DATA_TYPE_OBJECT);
        request.setResponseClazz(AdsBean.class);
        BaseRequestUtil.getInstance().add(request);
        callBack.setUrl(request.getUrl());
    }


    public static void getBookDeskCatalogue(String versionId, final BaseCallBack callBack) {
        Map<String, String> params = new HashMap<String, String>();
        params.put(HttpRequest.REQUEST_MODULES, EpaperAction.class.getName());
        params.put(HttpRequest.REQUEST_ACTION,
                EpaperAction.ACTION_BOOK_DESK_CATALOGUES);
        //TODO 先写死，无数据
        params.put("versionId", versionId + "");

        HttpRequest request = new HttpRequest(params,
                new Response.ErrorListener() {

                    @Override
                    public void onErrorResponse(VolleyError error) {
                        callBack.failed(error);
                    }
                }, new BaseRequest.ResponseCallback() {

            @Override
            public void error(int errorCode, String msg) {
                callBack.failed(errorCode, msg);
            }

            @Override
            public void success(Object obj, int resultCode,
                                int errorCode, String msg) {
                if (resultCode == 0 && errorCode == 0) {
                    callBack.success(obj);
                } else {
                    callBack.failed(errorCode, msg);
                }
            }
        });
        request.setResponseDataType(HttpRequest.RESPONSE_DATA_TYPE_OBJECT);
        request.setResponseClazz(BookDeskCataloguesBean.class);
        BaseRequestUtil.getInstance().add(request);
        callBack.setUrl(request.getUrl());
    }

    /**
     * 获取评分系数
     */
    public static void getScoreCoefficient(final BaseCallBack callBack) {
        Map<String, String> params = new HashMap<String, String>();
        params.put(com.ciwong.epaper.util.HttpRequest.REQUEST_MODULES, EpaperAction.class.getName());
        params.put(com.ciwong.epaper.util.HttpRequest.REQUEST_ACTION, EpaperAction.ACTION_GET_SCORE_COEFFICIENT);
        params.put("brandId", EApplication.BRAND_ID + "");
        HttpRequest request = new HttpRequest(params,
                new Response.ErrorListener() {
                    @Override
                    public void onErrorResponse(VolleyError volleyError) {
                        callBack.failed(volleyError);
                    }
                }, new BaseRequest.ResponseCallback() {
            @Override
            public void error(int errorCode, String msg) {
                callBack.failed(errorCode, msg);
            }

            @Override
            public void success(Object obj, int resultCode,
                                int errorCode, String msg) {
                if (resultCode == 0 && errorCode == 0) {
                    callBack.success(obj);
                } else {
                    callBack.failed(errorCode, msg);
                }
            }
        });
        request.setResponseDataType(HttpRequest.RESPONSE_DATA_TYPE_OBJECT);
        request.setResponseClazz(Float.class);
        BaseRequestUtil.getInstance().add(request);
        callBack.setUrl(request.getUrl());
    }

    /**
     * 根据年级查询配音资源列表
     *
     * @param gradeId
     * @param
     */
    public static void getDubbingVideoList(int gradeId, int pageIndex, int pageSize,
                                           final BaseCallBack callBack) {
        Map<String, String> params = new HashMap<String, String>();
        params.put(HttpRequest.REQUEST_MODULES, EpaperAction.class.getName());
        params.put(HttpRequest.REQUEST_ACTION,
                EpaperAction.ACTION_GET_DUBBING_VIDEO_LIST);
        params.put("gradeId", gradeId + "");
//        params.put("gradeId", "9999");
        params.put("page", pageIndex + "");
        params.put("pagesize", pageSize + "");

        HttpRequest request = new HttpRequest(params,
                new Response.ErrorListener() {

                    @Override
                    public void onErrorResponse(VolleyError error) {
                        callBack.failed(error);
                    }
                }, new BaseRequest.ResponseCallback() {

            @Override
            public void error(int errorCode, String msg) {
                callBack.failed(errorCode, msg);
            }

            @Override
            public void success(Object obj, int resultCode,
                                int errorCode, String msg) {
                if (resultCode == 0 && errorCode == 0) {
                    callBack.success(obj);
                } else {
                    callBack.failed(errorCode, msg);
                }
            }
        });
        request.setResponseDataType(HttpRequest.RESPONSE_DATA_TYPE_OBJECT);
        Type responseType = new TypeToken<List<WorkContent>>() {
        }.getType();
        request.setResponseType(responseType);
        BaseRequestUtil.getInstance().add(request);
        callBack.setUrl(request.getUrl());
    }

    /**
     * 获取广告
     *
     * @param callBack
     */
    public static void getHeadAds(int brandId, final BaseCallBack callBack) {
        Map<String, String> params = new HashMap<String, String>();
        params.put(HttpRequest.REQUEST_MODULES, EpaperAction.class.getName());
        params.put(HttpRequest.REQUEST_ACTION,
                EpaperAction.ACTION_GET_HEAD_ADS);
        params.put("brandId", brandId + "");
        params.put("appType", 1 + "");
        params.put("tag", 1 + "");

        HttpRequest request = new HttpRequest(params,
                new Response.ErrorListener() {

                    @Override
                    public void onErrorResponse(VolleyError error) {
                        callBack.failed(error);
                    }
                }, new BaseRequest.ResponseCallback() {

            @Override
            public void error(int errorCode, String msg) {
                callBack.failed(errorCode, msg);
            }

            @Override
            public void success(Object obj, int resultCode,
                                int errorCode, String msg) {
                if (resultCode == 0 && errorCode == 0) {
                    callBack.success(obj);
                } else {
                    callBack.failed(errorCode, msg);
                }
            }
        });
        request.setResponseDataType(HttpRequest.RESPONSE_DATA_TYPE_OBJECT);
        Type responseType = new TypeToken<List<Ad>>() {
        }.getType();
        request.setResponseType(responseType);
        BaseRequestUtil.getInstance().add(request);
        callBack.setUrl(request.getUrl());
    }


    /**
     * 获取广告
     *
     * @param callBack
     */
    public static void getHeadBookMarkAds(int brandId, final BaseCallBack callBack) {
        Map<String, String> params = new HashMap<String, String>();
        params.put(HttpRequest.REQUEST_MODULES, EpaperAction.class.getName());
        params.put(HttpRequest.REQUEST_ACTION,
                EpaperAction.ACTION_GET_TEACHER_DESK_HEAD);
        params.put("brandId", brandId + "");
        params.put("appType", 1 + "");
        params.put("tag", 1 + "");

        HttpRequest request = new HttpRequest(params,
                new Response.ErrorListener() {

                    @Override
                    public void onErrorResponse(VolleyError error) {
                        callBack.failed(error);
                    }
                }, new BaseRequest.ResponseCallback() {

            @Override
            public void error(int errorCode, String msg) {
                callBack.failed(errorCode, msg);
            }

            @Override
            public void success(Object obj, int resultCode,
                                int errorCode, String msg) {
                if (resultCode == 0 && errorCode == 0) {
                    callBack.success(obj);
                } else {
                    callBack.failed(errorCode, msg);
                }
            }
        });
        request.setResponseDataType(HttpRequest.RESPONSE_DATA_TYPE_OBJECT);
        request.setResponseClazz(AdsBean.class);
        BaseRequestUtil.getInstance().add(request);
        callBack.setUrl(request.getUrl());
    }

    /**
     * 根据资源
     *
     * @param versionId
     * @param
     */
    public static void getDubVideoDetail(String versionId,
                                         final BaseCallBack callBack) {
        Map<String, String> params = new HashMap<String, String>();
        params.put(HttpRequest.REQUEST_MODULES, EpaperAction.class.getName());
        params.put(HttpRequest.REQUEST_ACTION,
                EpaperAction.ACTION_GET_DUBBING_VIDEO_DETAIL);
        params.put("versionId", versionId);

        HttpRequest request = new HttpRequest(params,
                new Response.ErrorListener() {

                    @Override
                    public void onErrorResponse(VolleyError error) {
                        callBack.failed(error);
                    }
                }, new BaseRequest.ResponseCallback() {

            @Override
            public void error(int errorCode, String msg) {
                callBack.failed(errorCode, msg);
            }

            @Override
            public void success(Object obj, int resultCode,
                                int errorCode, String msg) {
                if (resultCode == 0 && errorCode == 0) {
                    callBack.success(obj);
                } else {
                    callBack.failed(errorCode, msg);
                }
            }
        });
        request.setResponseDataType(HttpRequest.RESPONSE_DATA_TYPE_OBJECT);
        Type responseType = new TypeToken<WorkContent>() {
        }.getType();
        request.setResponseType(responseType);
        BaseRequestUtil.getInstance().add(request);
        callBack.setUrl(request.getUrl());
    }

    /**
     * 查询配音记录列表
     *
     * @param pageIndex
     * @param pageSize
     */
    public static void getDubbingVideoRecordList(int pageIndex, int pageSize,
                                                 final BaseCallBack callBack) {
        Map<String, String> params = new HashMap<String, String>();
        params.put(HttpRequest.REQUEST_MODULES, EpaperAction.class.getName());
        params.put(HttpRequest.REQUEST_ACTION,
                EpaperAction.ACTION_GET_DUBBING_VIDEO_RECORD_LIST);
        params.put("page", pageIndex + "");
        params.put("pagesize", pageSize + "");

        HttpRequest request = new HttpRequest(params,
                new Response.ErrorListener() {

                    @Override
                    public void onErrorResponse(VolleyError error) {
                        callBack.failed(error);
                    }
                }, new BaseRequest.ResponseCallback() {

            @Override
            public void error(int errorCode, String msg) {
                callBack.failed(errorCode, msg);
            }

            @Override
            public void success(Object obj, int resultCode,
                                int errorCode, String msg) {
                if (resultCode == 0 && errorCode == 0) {
                    callBack.success(obj);
                } else {
                    callBack.failed(errorCode, msg);
                }
            }
        });
        request.setResponseDataType(HttpRequest.RESPONSE_DATA_TYPE_OBJECT);
        Type responseType = new TypeToken<List<VideoRecord>>() {
        }.getType();
        request.setResponseType(responseType);
        BaseRequestUtil.getInstance().add(request);
        callBack.setUrl(request.getUrl());

    }

    public static void getMyClass(String brandId, int userRole, int schoolId, final BaseCallBack callBack) {
        Map<String, String> params = new HashMap<String, String>();
        params.put(HttpRequest.REQUEST_MODULES, EpaperAction.class.getName());
        params.put(HttpRequest.REQUEST_ACTION,
                EpaperAction.ACTION_MY_CLASS_LIST);
        params.put("brandId", brandId);
        params.put("userRole", userRole + "");
        params.put("schoolId", schoolId + "");
        HttpRequest request = new HttpRequest(params,
                new Response.ErrorListener() {

                    @Override
                    public void onErrorResponse(VolleyError error) {
                        callBack.failed(error);
                    }
                }, new BaseRequest.ResponseCallback() {

            @Override
            public void error(int errorCode, String msg) {
                callBack.failed(errorCode, msg);
            }

            @Override
            public void success(Object obj, int resultCode,
                                int errorCode, String msg) {
                if (resultCode == 0 && errorCode == 0) {
                    callBack.success(obj);
                } else {
                    callBack.failed(errorCode, msg);
                }
            }
        });
        request.setResponseDataType(HttpRequest.RESPONSE_DATA_TYPE_OBJECT);
        Type responseType = new TypeToken<List<TeacherClassBean>>() {
        }.getType();
        request.setResponseType(responseType);
        BaseRequestUtil.getInstance().add(request);
        callBack.setUrl(request.getUrl());
    }

    /**
     * 查询班级成员
     *
     * @param classId
     * @param clientId
     * @param getIntegral
     * @param getVip
     * @param role
     */
    public static void getmembers(int classId, String clientId, int getIntegral, int getVip, int role, final BaseCallBack callBack) {

        Map<String, String> params = new HashMap<String, String>();
        params.put(HttpRequest.REQUEST_MODULES, EpaperAction.class.getName());
        params.put(HttpRequest.REQUEST_ACTION,
                EpaperAction.ACTION_MY_MEMBERS_LIST);
        params.put("_classId", classId + "");
        params.put("clientId", clientId);
        params.put("getIntegral", getIntegral + "");
        params.put("getVip", getVip + "");
        params.put("role", role + "");
        HttpRequest request = new HttpRequest(params,
                new Response.ErrorListener() {

                    @Override
                    public void onErrorResponse(VolleyError error) {
                        callBack.failed(error);
                    }
                }, new BaseRequest.ResponseCallback() {

            @Override
            public void error(int errorCode, String msg) {
                callBack.failed(errorCode, msg);
            }

            @Override
            public void success(Object obj, int resultCode,
                                int errorCode, String msg) {
                if (resultCode == 0 && errorCode == 0) {
                    callBack.success(obj);
                } else {
                    callBack.failed(errorCode, msg);
                }
            }
        });
        request.setResponseDataType(HttpRequest.RESPONSE_DATA_TYPE_OBJECT);
        Type responseType = new TypeToken<List<StudentBean>>() {
        }.getType();
        request.setResponseType(responseType);
        BaseRequestUtil.getInstance().add(request);
        callBack.setUrl(request.getUrl());

    }

    public static void getPublishWorkRecords(int brandId, int workStatus, int classId, int checkDate, long startDate, long endDate, int page, int pageSize, final BaseExtCallBack callBack) {
        Map<String, String> params = new HashMap<String, String>();
        params.put(HttpRequest.REQUEST_MODULES, EpaperAction.class.getName());
        params.put(HttpRequest.REQUEST_ACTION,
                EpaperAction.ACTION_PUBLIS_WORK_LIST);
        params.put("page", page + "");
        params.put("workStatus", workStatus + "");
        params.put("pageSize", pageSize + "");
        params.put("brandId", brandId + "");
        params.put("classId", classId + "");
        params.put("checkDate", checkDate + "");
        params.put("startDate", startDate + "");
        params.put("endDate", endDate + "");
        HttpRequest request = new HttpRequest(params,
                new Response.ErrorListener() {

                    @Override
                    public void onErrorResponse(VolleyError error) {
                        callBack.failed(error);
                    }
                }, new BaseRequest.ResponseCallback() {

            @Override
            public void error(int errorCode, String msg) {
                callBack.failed(errorCode, msg);
            }

            @Override
            public void success(Object obj, int resultCode,
                                int errorCode, String msg) {
                if (resultCode == 0 && errorCode == 0) {
                    callBack.success(obj);
                } else {
                    callBack.failed(errorCode, msg);
                }
            }
        });
        request.setResponseDataType(HttpRequest.RESPONSE_DATA_TYPE_OBJECT);
        Type responseType = new TypeToken<PublishWorkRecordsPageBean>() {
        }.getType();
        request.setResponseType(responseType);
        BaseRequestUtil.getInstance().add(request);
        callBack.setUrl(request.getUrl());
    }

    public static void getClassWorkRecords(int brandId, int page, int pageSize, final BaseCallBack callBack) {
        Map<String, String> params = new HashMap<String, String>();
        params.put(HttpRequest.REQUEST_MODULES, EpaperAction.class.getName());
        params.put(HttpRequest.REQUEST_ACTION,
                EpaperAction.ACTION_PUBLISH_CLASS_WORK_LIST);
        params.put("page", page + "");
        params.put("pageSize", pageSize + "");
        params.put("brandId", brandId + "");
        HttpRequest request = new HttpRequest(params,
                new Response.ErrorListener() {

                    @Override
                    public void onErrorResponse(VolleyError error) {
                        callBack.failed(error);
                    }
                }, new BaseRequest.ResponseCallback() {

            @Override
            public void error(int errorCode, String msg) {
                callBack.failed(errorCode, msg);
            }

            @Override
            public void success(Object obj, int resultCode,
                                int errorCode, String msg) {
                if (resultCode == 0 && errorCode == 0) {
                    callBack.success(obj);
                } else {
                    callBack.failed(errorCode, msg);
                }
            }
        });
        request.setResponseDataType(HttpRequest.RESPONSE_DATA_TYPE_OBJECT);
        Type responseType = new TypeToken<ClassWorkRecordsPageBean>() {
        }.getType();
        request.setResponseType(responseType);
        BaseRequestUtil.getInstance().add(request);
        callBack.setUrl(request.getUrl());
    }

    public static void getDkWorkRecords(int brandId, int page, int pageSize, int state, final BaseExtCallBack callBack) {
        Map<String, String> params = new HashMap<String, String>();
        params.put(HttpRequest.REQUEST_MODULES, EpaperAction.class.getName());
        params.put(HttpRequest.REQUEST_ACTION,
                EpaperAction.ACTION_PUBLISH_DK_WORK);
        params.put("page", page + "");
        params.put("pageSize", pageSize + "");
        params.put("brandId", brandId + "");
        params.put("state", state + "");
        HttpRequest request = new HttpRequest(params,
                new Response.ErrorListener() {

                    @Override
                    public void onErrorResponse(VolleyError error) {
                        callBack.failed(error);
                    }
                }, new BaseRequest.ResponseCallback() {

            @Override
            public void error(int errorCode, String msg) {
                callBack.failed(errorCode, msg);
            }

            @Override
            public void success(Object obj, int resultCode,
                                int errorCode, String msg) {
                if (resultCode == 0 && errorCode == 0) {
                    callBack.success(obj);
                } else {
                    callBack.failed(errorCode, msg);
                }
            }
        });
        request.setResponseDataType(HttpRequest.RESPONSE_DATA_TYPE_OBJECT);
        Type responseType = new TypeToken<PublishDKWorkRecordsPageBean>() {
        }.getType();
        request.setResponseType(responseType);
        BaseRequestUtil.getInstance().add(request);
        callBack.setUrl(request.getUrl());
    }


    public static void getServiceProductsByTop(int brandId, int isOwn, int pageIndex, int pageSize, int showPwd, int state, String wappid, final BaseExtCallBack callBack) {
        Map<String, String> params = new HashMap<String, String>();
        params.put(HttpRequest.REQUEST_MODULES, EpaperAction.class.getName());
        params.put(HttpRequest.REQUEST_ACTION,
                EpaperAction.ACTION_FAVORITES_LIST);
        params.put("pageIndex", pageIndex + "");
        params.put("pageSize", pageSize + "");
        params.put("brandId", brandId + "");
        params.put("isOwn", isOwn + "");
        params.put("showPwd", showPwd + "");
        params.put("state", state + "");
        params.put("wappid", wappid);
        HttpRequest request = new HttpRequest(params,
                new Response.ErrorListener() {

                    @Override
                    public void onErrorResponse(VolleyError error) {
                        callBack.failed(error);
                    }
                }, new BaseRequest.ResponseCallback() {

            @Override
            public void error(int errorCode, String msg) {
                callBack.failed(errorCode, msg);
            }

            @Override
            public void success(Object obj, int resultCode,
                                int errorCode, String msg) {
                if (resultCode == 0 && errorCode == 0) {
                    callBack.success(obj);
                } else {
                    callBack.failed(errorCode, msg);
                }
            }
        });
        request.setResponseDataType(HttpRequest.RESPONSE_DATA_TYPE_OBJECT);
        Type responseType = new TypeToken<FavoritesBookPageBean>() {
        }.getType();
        request.setResponseType(responseType);
        BaseRequestUtil.getInstance().add(request);
        callBack.setUrl(request.getUrl());
    }

    /**
     * @param brandId
     * @param publishUserName   布置人名
     * @param workName          作业名
     * @param workType          作业类型
     * @param examMode          作业类型
     * @param seeWorkMode       查看作业类型
     * @param submitMode        提交作业类型
     * @param showScoreMode     显示分数类型
     * @param abMode            ab卷模式
     * @param autoRefuseMode    是否自动退回模式，1-需要自动退回 0-不需要自动退回。
     * @param autoRefusePercent 自动退回用户设定的分值百分比数字值
     * @param completeDate      作业完成时间
     * @param sendDate          布置日期
     * @param workMessageType   作业消息
     * @param subjectId
     * @param sourceType
     * @param bookName          书名
     * @param publishType
     * @param classList         布置对象集合
     * @param contents
     * @param isClassWork       是否是课堂作业
     * @param callBack
     */
    public static void publishWork(int brandId, int showAnswerMode, String publishUserName, String workName, int workType, int examMode, int seeWorkMode,
                                   int submitMode, int showScoreMode, int abMode, int autoRefuseMode, int autoRefusePercent, int autoRefuseNum, long completeDate,
                                   long sendDate, int workMessageType, int subjectId, int sourceType, String bookName, int publishType, int schoolId, String schoolName, String areaCode,
                                   List<PubLishClassBean> classList, List<PublishWorkContent> contents, boolean isClassWork, final BaseExtCallBack callBack) {
        Map<String, String> params = new HashMap<String, String>();
        params.put(HttpRequest.REQUEST_MODULES, EpaperAction.class.getName());
        if (isClassWork) {
            //课堂讲练
            params.put(HttpRequest.REQUEST_ACTION,
                    EpaperAction.ACTION_PUBLISH_CLASS_WORK);
        } else {
            //课后作业
            params.put(HttpRequest.REQUEST_ACTION,
                    EpaperAction.ACTION_PUBLISH_WORK);
        }
        List<PublishWorkContentUpload> contentsUpload = new ArrayList<PublishWorkContentUpload>();
        for (int i = 0; i < contents.size(); i++) {
            PublishWorkContent item = contents.get(i);
            PublishWorkContentUpload itemUpload = new PublishWorkContentUpload();
            itemUpload.setcId(item.getcId());
            itemUpload.setCheckedResource(item.getCheckedResource());
            itemUpload.setModuleId(item.getModuleId());
            itemUpload.setPackageId(item.getPackageId());
            itemUpload.setParentVersionId(item.getParentVersionId());
            itemUpload.setRefLong(item.getRefLong());
            itemUpload.setRequirementContent(item.getRequirementContent());
            itemUpload.setResourceType(item.getResourceType());
            itemUpload.setResourceName(item.getResourceName());
            itemUpload.setVersionId(item.getVersionId());
            itemUpload.setWorkScore(item.getWorkScore());
            itemUpload.setWorkType(item.getWorkType());
            itemUpload.setIsFree(item.getFavoritesBook().getPackageIsFree());
            itemUpload.setWorkTag(item.getWorkTag());
            contentsUpload.add(itemUpload);
        }
        com.alibaba.fastjson.JSONObject publishWorkBean = new com.alibaba.fastjson.JSONObject();
        if (!isClassWork) {
            publishWorkBean.put("examMode", examMode);
            publishWorkBean.put("seeWorkMode", seeWorkMode);
            publishWorkBean.put("submitMode", submitMode);
            publishWorkBean.put("showAnswerMode", showAnswerMode);
            publishWorkBean.put("showScoreMode", showScoreMode);
            publishWorkBean.put("abMode", abMode);
            publishWorkBean.put("autoRefuseMode", autoRefuseMode);
            publishWorkBean.put("autoRefusePercent", autoRefusePercent);
            publishWorkBean.put("autoRefuseNum", autoRefuseNum);
            publishWorkBean.put("sendDate", sendDate);
            publishWorkBean.put("state", 3);
            publishWorkBean.put("workMessage", "同学们，请按时完成作业哦。");
            publishWorkBean.put("completeDate", completeDate);
            publishWorkBean.put("workMessageType", workMessageType);
            publishWorkBean.put("publishType", publishType);
            publishWorkBean.put("bookName", bookName);
        }
        publishWorkBean.put("publishUserName", publishUserName);
        publishWorkBean.put("workType", workType);
        publishWorkBean.put("brandId", brandId);
        publishWorkBean.put("subjectId", subjectId);
        publishWorkBean.put("sourceType", sourceType);
        publishWorkBean.put("classList", classList);
        publishWorkBean.put("contents", contentsUpload);
        publishWorkBean.put("workName", workName);
        publishWorkBean.put("schoolId", schoolId);
        publishWorkBean.put("schoolName", schoolName);
        publishWorkBean.put("areaCode", areaCode);


        final String json = publishWorkBean.toString();
        HeadOverrideRequest request = new HeadOverrideRequest(Request.Method.POST, params,
                new Response.ErrorListener() {
                    @Override
                    public void onErrorResponse(VolleyError volleyError) {
                        CWLog.e("byou", volleyError.getMessage());
                        byte[] htmlBodyBytes = volleyError.networkResponse.data;
                        CWLog.e("byou", new String(htmlBodyBytes));
                        callBack.failed(volleyError);
                    }
                }, new BaseRequest.ResponseCallback() {
            @Override
            public void error(int errorCode, String msg) {
                callBack.failed(errorCode, msg);

            }

            @Override
            public void success(Object obj, int resultCode, int errorCode, String msg) {
                if (resultCode == 0 && errorCode == 0) {
                    if (null != callBack)
                        callBack.success(obj);
                } else {
                    if (null != callBack) {
                        callBack.failed(errorCode, msg);
                    }
                }
            }
        }) {
            @Override
            public byte[] getBody() throws AuthFailureError {
                return json.getBytes();
            }
        };

        request.setResponseDataType(HttpRequest.RESPONSE_DATA_TYPE_OBJECT);
        request.setResponseClazz(PublishWorkResult.class);
        request.setPriority(Request.Priority.HIGH);
        BaseRequestUtil.getInstance().add(request);
        callBack.setUrl(request.getUrl());
    }

    public static void getResourceStatisticsWeb(String parentVersionId, String versionId, int moduleId, String resourceType, final BaseCallBack callBack) {
        Map<String, String> params = new HashMap<String, String>();
        params.put(HttpRequest.REQUEST_MODULES, EpaperAction.class.getName());
        params.put(HttpRequest.REQUEST_ACTION,
                EpaperAction.ACTION_RESOURCE_STATISTICS_WEB);
        params.put("parentVersionId", parentVersionId);
        params.put("versionId", versionId);
        params.put("moduleId", moduleId + "");
        params.put("resourceType", resourceType);
        HttpRequest request = new HttpRequest(params,
                new Response.ErrorListener() {

                    @Override
                    public void onErrorResponse(VolleyError error) {
                        callBack.failed(error);
                    }
                }, new BaseRequest.ResponseCallback() {

            @Override
            public void error(int errorCode, String msg) {
                callBack.failed(errorCode, msg);
            }

            @Override
            public void success(Object obj, int resultCode,
                                int errorCode, String msg) {
                if (resultCode == 0 && errorCode == 0) {
                    callBack.success(obj);
                } else {
                    callBack.failed(errorCode, msg);
                }
            }
        });
        request.setResponseDataType(HttpRequest.RESPONSE_DATA_TYPE_OBJECT);
        Type responseType = new TypeToken<ResourceContent>() {
        }.getType();
        request.setResponseType(responseType);
        BaseRequestUtil.getInstance().add(request);
        callBack.setUrl(request.getUrl());
    }

    public static void getPublishResources(String packageId, String cId, final BaseCallBack callBack) {
        Map<String, String> params = new HashMap<String, String>();
        params.put(HttpRequest.REQUEST_MODULES, EpaperAction.class.getName());
        params.put(HttpRequest.REQUEST_ACTION,
                EpaperAction.ACTION_GET_PUBLISH_RESOURCES);
        params.put("packageId", packageId);
        params.put("cId", cId);
        HttpRequest request = new HttpRequest(params,
                new Response.ErrorListener() {

                    @Override
                    public void onErrorResponse(VolleyError error) {
                        callBack.failed(error);
                    }
                }, new BaseRequest.ResponseCallback() {

            @Override
            public void error(int errorCode, String msg) {
                callBack.failed(errorCode, msg);
            }

            @Override
            public void success(Object obj, int resultCode,
                                int errorCode, String msg) {
                if (resultCode == 0 && errorCode == 0) {
                    callBack.success(obj);
                } else {
                    callBack.failed(errorCode, msg);
                }
            }
        });
        request.setResponseDataType(HttpRequest.RESPONSE_DATA_TYPE_OBJECT);
        Type responseType = new TypeToken<List<PublishResource>>() {
        }.getType();
        request.setResponseType(responseType);
        BaseRequestUtil.getInstance().add(request);
        callBack.setUrl(request.getUrl());

    }

    public static void listenSpeakExamination(String versionid, final BaseCallBack callBack) {
        Map<String, String> params = new HashMap<String, String>();
        params.put(HttpRequest.REQUEST_MODULES, EpaperAction.class.getName());
        params.put(HttpRequest.REQUEST_ACTION,
                EpaperAction.ACTION_RESOURCE_STATISTICS_WEB);
        params.put("versionid", versionid);
        HttpRequest request = new HttpRequest(params,
                new Response.ErrorListener() {

                    @Override
                    public void onErrorResponse(VolleyError error) {
                        callBack.failed(error);
                    }
                }, new BaseRequest.ResponseCallback() {

            @Override
            public void error(int errorCode, String msg) {
                callBack.failed(errorCode, msg);
            }

            @Override
            public void success(Object obj, int resultCode,
                                int errorCode, String msg) {
                if (resultCode == 0 && errorCode == 0) {
                    callBack.success(obj);
                } else {
                    callBack.failed(errorCode, msg);
                }
            }
        });
        request.setResponseDataType(HttpRequest.RESPONSE_DATA_TYPE_OBJECT);
        Type responseType = new TypeToken<ResourceContent>() {
        }.getType();
        request.setResponseType(responseType);
        BaseRequestUtil.getInstance().add(request);
        callBack.setUrl(request.getUrl());
    }

    public static void followreadWordDetails(String versionid, final BaseCallBack callBack) {
        Map<String, String> params = new HashMap<String, String>();
        params.put(HttpRequest.REQUEST_MODULES, EpaperAction.class.getName());
        params.put(HttpRequest.REQUEST_ACTION,
                EpaperAction.ACTION_FOLLOWREAD_WORD_DETAILS);
        params.put("versionid", versionid);
        HttpRequest request = new HttpRequest(params,
                new Response.ErrorListener() {

                    @Override
                    public void onErrorResponse(VolleyError error) {
                        callBack.failed(error);
                    }
                }, new BaseRequest.ResponseCallback() {

            @Override
            public void error(int errorCode, String msg) {
                callBack.failed(errorCode, msg);
            }

            @Override
            public void success(Object obj, int resultCode,
                                int errorCode, String msg) {
                if (resultCode == 0 && errorCode == 0) {
                    callBack.success(obj);
                } else {
                    callBack.failed(errorCode, msg);
                }
            }
        });
        request.setResponseDataType(HttpRequest.RESPONSE_DATA_TYPE_OBJECT);
        Type responseType = new TypeToken<List<FollowReadWordDetails>>() {
        }.getType();
        request.setResponseType(responseType);
        BaseRequestUtil.getInstance().add(request);
        callBack.setUrl(request.getUrl());
    }

    /**
     * 根据服务ID获取书籍并分页（布置作业时，查询的书）,通过传班级ID
     *
     * @param brandId
     * @param isOwn
     * @param mBookmarkId
     * @param serviceId
     * @param classIds
     * @param schoolId
     * @param gradeId
     * @param bookType
     * @param keyWords
     * @param pageIndex
     * @param pageSize
     * @param callBack
     */
    public static void getServiceProductsByIdClassids(int brandId, int isOwn, int mBookmarkId, int serviceId, String subCategoryId, String classIds, long schoolId, int gradeId, int bookType, String keyWords, int pageIndex, int pageSize, final BaseExtCallBack callBack) {
        Map<String, String> params = new HashMap<String, String>();
        params.put(HttpRequest.REQUEST_MODULES, EpaperAction.class.getName());
        params.put(HttpRequest.REQUEST_ACTION,
                EpaperAction.ACTION_GET_SERVICE_PRODUCTS);
        params.put("brandId", brandId + "");
        params.put("serviceId", serviceId + "");
        params.put("classIds", classIds);
        params.put("subCategoryId", subCategoryId);
        params.put("schoolId", schoolId + "");
        params.put("gradeId", gradeId + "");
        params.put("bookType", bookType + "");
        if (isOwn != 0) {
            params.put("isOwn", isOwn + "");
        }
        if (null != keyWords && !"".equals(keyWords)) {
            params.put("keyWords", keyWords);
        }
        if (0 != mBookmarkId) {
            params.put("bookmarkId", mBookmarkId + "");
        }
        params.put("pageIndex", pageIndex + "");
        params.put("pageSize", pageSize + "");
        params.put("showPwd", 1 + "");
        HttpRequest request = new HttpRequest(params,
                new Response.ErrorListener() {

                    @Override
                    public void onErrorResponse(VolleyError error) {
                        callBack.failed(error);
                    }
                }, new BaseRequest.ResponseCallback() {

            @Override
            public void error(int errorCode, String msg) {
                callBack.failed(errorCode, msg);
            }

            @Override
            public void success(Object obj, int resultCode,
                                int errorCode, String msg) {
                if (resultCode == 0 && errorCode == 0) {
                    callBack.success(obj);
                } else {
                    callBack.failed(errorCode, msg);
                }
            }
        });
        request.setResponseDataType(HttpRequest.RESPONSE_DATA_TYPE_OBJECT);
        Type responseType = new TypeToken<ServiceProductsBean>() {
        }.getType();
        request.setResponseType(responseType);
        BaseRequestUtil.getInstance().add(request);
        callBack.setUrl(request.getUrl());
    }

    /**
     * 按书签查询有书的年级（老师）
     *
     * @param brandId
     * @param mBookmarkId
     * @param callBack
     */
    public static void getGradeByBookmarkId(int brandId, int mBookmarkId, final BaseExtCallBack callBack) {
        Map<String, String> params = new HashMap<String, String>();
        params.put(HttpRequest.REQUEST_MODULES, EpaperAction.class.getName());
        params.put(HttpRequest.REQUEST_ACTION,
                EpaperAction.ACTION_GET_TEACHER_GRADE_BY_BOOKMARK);
        params.put("brandId", brandId + "");
        params.put("bookmarkId", mBookmarkId + "");
        HttpRequest request = new HttpRequest(params,
                new Response.ErrorListener() {

                    @Override
                    public void onErrorResponse(VolleyError error) {
                        callBack.failed(error);
                    }
                }, new BaseRequest.ResponseCallback() {

            @Override
            public void error(int errorCode, String msg) {
                callBack.failed(errorCode, msg);
            }

            @Override
            public void success(Object obj, int resultCode,
                                int errorCode, String msg) {
                if (resultCode == 0 && errorCode == 0) {
                    callBack.success(obj);
                } else {
                    callBack.failed(errorCode, msg);
                }
            }
        });
        request.setResponseDataType(HttpRequest.RESPONSE_DATA_TYPE_OBJECT);
        Type responseType = new TypeToken<List<GradeBean>>() {
        }.getType();
        request.setResponseType(responseType);
        BaseRequestUtil.getInstance().add(request);
        callBack.setUrl(request.getUrl());
    }

    public static void getTeacherHead(int brandId, String serviceIds, final BaseExtCallBack callBack) {
        Map<String, String> params = new HashMap<String, String>();
        params.put(HttpRequest.REQUEST_MODULES, EpaperAction.class.getName());
        params.put(HttpRequest.REQUEST_ACTION,
                EpaperAction.ACTION_GET_TEACHER);
        params.put("brandId", brandId + "");
        params.put("serviceIds", serviceIds + "");
        HttpRequest request = new HttpRequest(params,
                new Response.ErrorListener() {

                    @Override
                    public void onErrorResponse(VolleyError error) {
                        callBack.failed(error);
                    }
                }, new BaseRequest.ResponseCallback() {

            @Override
            public void error(int errorCode, String msg) {
                callBack.failed(errorCode, msg);
            }

            @Override
            public void success(Object obj, int resultCode,
                                int errorCode, String msg) {
                if (resultCode == 0 && errorCode == 0) {
                    callBack.success(obj);
                } else {
                    callBack.failed(errorCode, msg);
                }
            }
        });
        request.setResponseDataType(HttpRequest.RESPONSE_DATA_TYPE_OBJECT);
        Type responseType = new TypeToken<BookDeskBean>() {
        }.getType();
        request.setResponseType(responseType);
        BaseRequestUtil.getInstance().add(request);
        callBack.setUrl(request.getUrl());
    }

    public static void followreadTextParagraph(String versionId, final BaseCallBack callBack) {
        Map<String, String> params = new HashMap<String, String>();
        params.put(HttpRequest.REQUEST_MODULES, EpaperAction.class.getName());
        params.put(HttpRequest.REQUEST_ACTION,
                EpaperAction.ACTION_FOLLOWREAD_TEXT_PARAGRAPH);
        params.put("versionid", versionId);
        HttpRequest request = new HttpRequest(params,
                new Response.ErrorListener() {

                    @Override
                    public void onErrorResponse(VolleyError error) {
                        callBack.failed(error);
                    }
                }, new BaseRequest.ResponseCallback() {

            @Override
            public void error(int errorCode, String msg) {
                callBack.failed(errorCode, msg);
            }

            @Override
            public void success(Object obj, int resultCode,
                                int errorCode, String msg) {
                if (resultCode == 0 && errorCode == 0) {
                    callBack.success(obj);
                } else {
                    callBack.failed(errorCode, msg);
                }
            }
        });
        request.setResponseDataType(HttpRequest.RESPONSE_DATA_TYPE_OBJECT);
        Type responseType = new TypeToken<List<FollowreadTextParagraph>>() {
        }.getType();
        request.setResponseType(responseType);
        BaseRequestUtil.getInstance().add(request);
        callBack.setUrl(request.getUrl());
    }

    public static void ListenSpeakExaminAtion(String versionId, final BaseCallBack callBack) {
        Map<String, String> params = new HashMap<String, String>();
        params.put(HttpRequest.REQUEST_MODULES, EpaperAction.class.getName());
        params.put(HttpRequest.REQUEST_ACTION,
                EpaperAction.ACTION_LISTEN_SPEAK_EXAMIN);
        params.put("versionid", versionId);
        HttpRequest request = new HttpRequest(params,
                new Response.ErrorListener() {

                    @Override
                    public void onErrorResponse(VolleyError error) {
                        callBack.failed(error);
                    }
                }, new BaseRequest.ResponseCallback() {

            @Override
            public void error(int errorCode, String msg) {
                callBack.failed(errorCode, msg);
            }

            @Override
            public void success(Object obj, int resultCode,
                                int errorCode, String msg) {
                if (resultCode == 0 && errorCode == 0) {
                    callBack.success(obj);
                } else {
                    callBack.failed(errorCode, msg);
                }
            }
        });
        request.setResponseDataType(HttpRequest.RESPONSE_DATA_TYPE_OBJECT);
        Type responseType = new TypeToken<ListenSpeakExAminAtion>() {
        }.getType();
        request.setResponseType(responseType);
        BaseRequestUtil.getInstance().add(request);
        callBack.setUrl(request.getUrl());
    }

    public static void updateClassNameById(int classId, int periodId, int gradeId, String classAliasName, final BaseCallBack callBack) {
        Map<String, String> params = new HashMap<String, String>();
        params.put(HttpRequest.REQUEST_MODULES, EpaperAction.class.getName());
        params.put(HttpRequest.REQUEST_ACTION,
                EpaperAction.ACTION_UPDATE_CLASS_NAME);
        params.put("classId", classId + "");
        params.put("periodId", periodId + "");
        params.put("gradeId", gradeId + "");
        params.put("classAliasName", classAliasName);
        HttpRequest request = new HttpRequest(params,
                new Response.ErrorListener() {

                    @Override
                    public void onErrorResponse(VolleyError error) {
                        callBack.failed(error);
                    }
                }, new BaseRequest.ResponseCallback() {

            @Override
            public void error(int errorCode, String msg) {
                callBack.failed(errorCode, msg);
            }

            @Override
            public void success(Object obj, int resultCode,
                                int errorCode, String msg) {
                if (resultCode == 0 && errorCode == 0) {
                    callBack.success(obj);
                } else {
                    callBack.failed(errorCode, msg);
                }
            }
        });
        request.setResponseDataType(HttpRequest.RESPONSE_DATA_TYPE_OBJECT);
        Type responseType = new TypeToken<Boolean>() {
        }.getType();
        request.setResponseType(responseType);
        BaseRequestUtil.getInstance().add(request);
        callBack.setUrl(request.getUrl());
    }

    public static void examinationData(String versionId, final BaseCallBack callBack) {
        Map<String, String> params = new HashMap<String, String>();
        params.put(HttpRequest.REQUEST_MODULES, EpaperAction.class.getName());
        params.put(HttpRequest.REQUEST_ACTION,
                EpaperAction.ACTION_EXAMINTION_DATA);
        params.put("versionid", versionId);
        HttpRequest request = new HttpRequest(params,
                new Response.ErrorListener() {

                    @Override
                    public void onErrorResponse(VolleyError error) {
                        callBack.failed(error);
                    }
                }, new BaseRequest.ResponseCallback() {

            @Override
            public void error(int errorCode, String msg) {
                callBack.failed(errorCode, msg);
            }

            @Override
            public void success(Object obj, int resultCode,
                                int errorCode, String msg) {
                if (resultCode == 0 && errorCode == 0) {
                    callBack.success(obj);
                } else {
                    callBack.failed(errorCode, msg);
                }
            }
        });
        request.setResponseDataType(HttpRequest.RESPONSE_DATA_TYPE_OBJECT);
        Type responseType = new TypeToken<ListenSpeakExAminAtion>() {
        }.getType();
        request.setResponseType(responseType);
        BaseRequestUtil.getInstance().add(request);
        callBack.setUrl(request.getUrl());
    }

    public static void addTeam(String teamname, int classId, String stustr, final BaseCallBack callBack) {
        Map<String, String> params = new HashMap<String, String>();
        params.put(HttpRequest.REQUEST_MODULES, EpaperAction.class.getName());
        params.put(HttpRequest.REQUEST_ACTION, EpaperAction.ACTION_ADD_TEAM);
        com.alibaba.fastjson.JSONObject jsonObject = new com.alibaba.fastjson.JSONObject();
        jsonObject.put("teamname", teamname);
        jsonObject.put("stustr", stustr);
        jsonObject.put("classid", classId);
        final String sign = jsonObject.toString();
        HeadOverrideRequest request = new HeadOverrideRequest(Request.Method.POST, params,
                new Response.ErrorListener() {

                    @Override
                    public void onErrorResponse(VolleyError error) {
                        callBack.failed(error);
                    }
                }, new BaseRequest.ResponseCallback() {

            @Override
            public void error(int errorCode, String msg) {
                callBack.failed(errorCode, msg);

            }

            @Override
            public void success(Object obj, int resultCode, int errorCode, String msg) {
                if (resultCode == 0 && errorCode == 0) {
                    if (null != callBack)
                        callBack.success(obj);
                } else {
                    if (null != callBack) {
                        callBack.failed(errorCode, msg);
                    }
                }
            }
        }) {
            @Override
            public byte[] getBody() throws AuthFailureError {
                return sign.getBytes();
            }
        };
        request.setResponseDataType(HttpRequest.RESPONSE_DATA_TYPE_OBJECT);
        /*request.setResponseClazz(clazz);*/
        BaseRequestUtil.getInstance().add(request);
        callBack.setUrl(request.getUrl());
    }

    public static void editTeam(String teamname, int classId, String stustr, int teamId, final BaseCallBack callBack) {
        Map<String, String> params = new HashMap<String, String>();
        params.put(HttpRequest.REQUEST_MODULES, EpaperAction.class.getName());
        params.put(HttpRequest.REQUEST_ACTION, EpaperAction.ACTION_EDIT_TEAM);
        com.alibaba.fastjson.JSONObject jsonObject = new com.alibaba.fastjson.JSONObject();
        jsonObject.put("teamname", teamname);
        jsonObject.put("stustr", stustr);
        jsonObject.put("classid", classId);
        jsonObject.put("teamid", teamId);
        final String sign = jsonObject.toString();
        HeadOverrideRequest request = new HeadOverrideRequest(Request.Method.POST, params,
                new Response.ErrorListener() {

                    @Override
                    public void onErrorResponse(VolleyError error) {
                        callBack.failed(error);
                    }
                }, new BaseRequest.ResponseCallback() {

            @Override
            public void error(int errorCode, String msg) {
                callBack.failed(errorCode, msg);

            }

            @Override
            public void success(Object obj, int resultCode, int errorCode, String msg) {
                if (resultCode == 0 && errorCode == 0) {
                    if (null != callBack)
                        callBack.success(obj);
                } else {
                    if (null != callBack) {
                        callBack.failed(errorCode, msg);
                    }
                }
            }
        }) {
            @Override
            public byte[] getBody() throws AuthFailureError {
                return sign.getBytes();
            }
        };
        request.setResponseDataType(HttpRequest.RESPONSE_DATA_TYPE_OBJECT);
        /*request.setResponseClazz(clazz);*/
        BaseRequestUtil.getInstance().add(request);
        callBack.setUrl(request.getUrl());
    }

    public static void setUserBookTop(int istop, int productid, int serviceid, final BaseCallBack callBack) {
        Map<String, String> params = new HashMap<String, String>();
        params.put(HttpRequest.REQUEST_MODULES, EpaperAction.class.getName());
        params.put(HttpRequest.REQUEST_ACTION,
                EpaperAction.ACTION_SET_USER_BOOK_TOP);
        params.put("istop", istop + "");
        params.put("productid", productid + "");
        params.put("serviceid", serviceid + "");
        HttpRequest request = new HttpRequest(params,
                new Response.ErrorListener() {

                    @Override
                    public void onErrorResponse(VolleyError error) {
                        callBack.failed(error);
                    }
                }, new BaseRequest.ResponseCallback() {

            @Override
            public void error(int errorCode, String msg) {
                callBack.failed(errorCode, msg);
            }

            @Override
            public void success(Object obj, int resultCode,
                                int errorCode, String msg) {
                if (resultCode == 0 && errorCode == 0) {
                    callBack.success(obj);
                    callBack.success();
                } else {
                    callBack.failed(errorCode, msg);
                }
            }
        });
        request.setResponseDataType(HttpRequest.RESPONSE_DATA_TYPE_OBJECT);
        Type responseType = new TypeToken<String>() {
        }.getType();
        request.setResponseType(responseType);
        BaseRequestUtil.getInstance().add(request);
        callBack.setUrl(request.getUrl());
    }

    //修改退回分数
    public static void setAutoRefusePercent(long batchId, int state, long brandId, String wappid, int autoRefusePercent, final BaseCallBack callBack) {
        Map<String, String> params = new HashMap<String, String>();
        params.put(HttpRequest.REQUEST_MODULES, EpaperAction.class.getName());
        params.put(HttpRequest.REQUEST_ACTION, EpaperAction.ACTION_SET_AUTO_REFUSE_PERCENT);
        com.alibaba.fastjson.JSONObject jsonObject = new com.alibaba.fastjson.JSONObject();
        jsonObject.put("batchId", batchId);
        jsonObject.put("state", state);
        jsonObject.put("brandId", brandId);
        jsonObject.put("wappid", wappid);
        //jsonObject.put("clientId", clientId);
        jsonObject.put("autoRefusePercent", autoRefusePercent);
        final String sign = jsonObject.toString();
        HeadOverrideRequest request = new HeadOverrideRequest(Request.Method.POST, params,
                new Response.ErrorListener() {

                    @Override
                    public void onErrorResponse(VolleyError error) {
                        callBack.failed(error);
                    }
                }, new BaseRequest.ResponseCallback() {

            @Override
            public void error(int errorCode, String msg) {
                callBack.failed(errorCode, msg);

            }

            @Override
            public void success(Object obj, int resultCode, int errorCode, String msg) {
                if (resultCode == 0 && errorCode == 0) {
                    if (null != callBack)
                        callBack.success(obj);
                } else {
                    if (null != callBack) {
                        callBack.failed(errorCode, msg);
                    }
                }
            }
        }) {
            @Override
            public byte[] getBody() throws AuthFailureError {
                return sign.getBytes();
            }
        };
        request.setResponseDataType(HttpRequest.RESPONSE_DATA_TYPE_OBJECT);
        /*request.setResponseClazz(clazz);*/
        BaseRequestUtil.getInstance().add(request);
        callBack.setUrl(request.getUrl());
    }

    public static void setEffectiveDate(long batchId, int state, long brandId, String wappid, long clientId, long effectiveDate, final BaseCallBack callBack) {
        Map<String, String> params = new HashMap<String, String>();
        params.put(HttpRequest.REQUEST_MODULES, EpaperAction.class.getName());
        params.put(HttpRequest.REQUEST_ACTION, EpaperAction.ACTION_SET_EFFECTIVEDATE);
        com.alibaba.fastjson.JSONObject jsonObject = new com.alibaba.fastjson.JSONObject();
        jsonObject.put("batchId", batchId);
        jsonObject.put("state", state);
        jsonObject.put("brandId", brandId);
        jsonObject.put("wappid", wappid);
        jsonObject.put("clientId", clientId);
        jsonObject.put("effectiveDate", effectiveDate);
        final String sign = jsonObject.toString();
        HeadOverrideRequest request = new HeadOverrideRequest(Request.Method.POST, params,
                new Response.ErrorListener() {

                    @Override
                    public void onErrorResponse(VolleyError error) {
                        callBack.failed(error);
                    }
                }, new BaseRequest.ResponseCallback() {

            @Override
            public void error(int errorCode, String msg) {
                callBack.failed(errorCode, msg);

            }

            @Override
            public void success(Object obj, int resultCode, int errorCode, String msg) {
                if (resultCode == 0 && errorCode == 0) {
                    if (null != callBack)
                        callBack.success(obj);
                } else {
                    if (null != callBack) {
                        callBack.failed(errorCode, msg);
                    }
                }
            }
        }) {
            @Override
            public byte[] getBody() throws AuthFailureError {
                return sign.getBytes();
            }
        };
        request.setResponseDataType(HttpRequest.RESPONSE_DATA_TYPE_OBJECT);
        /*request.setResponseClazz(clazz);*/
        BaseRequestUtil.getInstance().add(request);
        callBack.setUrl(request.getUrl());
    }

    public static void getPublishbook(long userId, int brandId, int bookId, final BaseCallBack callBack) {
        Map<String, String> params = new HashMap<String, String>();
        params.put(HttpRequest.REQUEST_MODULES, EpaperAction.class.getName());
        params.put(HttpRequest.REQUEST_ACTION,
                EpaperAction.ACTION_GET_PUBLISH_BOOK);
        params.put("userId", userId + "");
        params.put("brandId", brandId + "");
        params.put("bookId", bookId + "");
        HttpRequest request = new HttpRequest(params,
                new Response.ErrorListener() {

                    @Override
                    public void onErrorResponse(VolleyError error) {
                        callBack.failed(error);
                    }
                }, new BaseRequest.ResponseCallback() {

            @Override
            public void error(int errorCode, String msg) {
                callBack.failed(errorCode, msg);
            }

            @Override
            public void success(Object obj, int resultCode,
                                int errorCode, String msg) {
                if (resultCode == 0 && errorCode == 0) {
                    callBack.success(obj);
                    callBack.success();
                } else {
                    callBack.failed(errorCode, msg);
                }
            }
        });
        request.setResponseDataType(HttpRequest.RESPONSE_DATA_TYPE_OBJECT);
        Type responseType = new TypeToken<List<PublishBook>>() {
        }.getType();
        request.setResponseType(responseType);
        BaseRequestUtil.getInstance().add(request);
        callBack.setUrl(request.getUrl());
    }

    /**
     * 验证书籍密码是否正确
     *
     * @param pwd
     * @param state
     * @param productId
     * @param serviceId
     * @param wappid
     * @param brandId
     * @param callBack
     */
    public static void checkServicePwd(String pwd, int state, int productId, int serviceId, String wappid, int brandId, final BaseCallBack callBack) {
        Map<String, String> params = new HashMap<String, String>();
        params.put(HttpRequest.REQUEST_MODULES, EpaperAction.class.getName());
        params.put(HttpRequest.REQUEST_ACTION,
                EpaperAction.ACTION_CHECK_SERVICE_PWD);
        params.put("pwd", pwd);
        params.put("state", state + "");
        params.put("productId", productId + "");
        params.put("serviceId", serviceId + "");
        params.put("wappid", wappid);
        params.put("brandId", brandId + "");
        HttpRequest request = new HttpRequest(params,
                new Response.ErrorListener() {

                    @Override
                    public void onErrorResponse(VolleyError error) {
                        callBack.failed(error);
                    }
                }, new BaseRequest.ResponseCallback() {

            @Override
            public void error(int errorCode, String msg) {
                callBack.failed(errorCode, msg);
            }

            @Override
            public void success(Object obj, int resultCode,
                                int errorCode, String msg) {
                if (resultCode == 0 && errorCode == 0) {
                    callBack.success(obj);
                    callBack.success();
                } else {
                    callBack.failed(errorCode, msg);
                }
            }
        });
        request.setResponseDataType(HttpRequest.RESPONSE_DATA_TYPE_OBJECT);
        /*Type responseType = new TypeToken<>() {
        }.getType();
        request.setResponseType(responseType);*/
        BaseRequestUtil.getInstance().add(request);
        callBack.setUrl(request.getUrl());
    }

    /**
     * 验证书籍章节密码是否正确
     *
     * @param pwd       密码
     * @param cId       章节ID
     * @param productId 书籍ID
     * @param serviceId 服务ID
     * @param callBack
     */
    public static void checkServiceCataloguesPwd(String pwd, String cId, int productId, int serviceId, final BaseCallBack callBack) {
        Map<String, String> params = new HashMap<String, String>();
        params.put(HttpRequest.REQUEST_MODULES, EpaperAction.class.getName());
        params.put(HttpRequest.REQUEST_ACTION,
                EpaperAction.ACTION_CHECK_SERVICE_CATALOGUES_PWD);
        params.put("pwd", pwd);
        params.put("cId", cId + "");
        params.put("packageId", productId + "");
        params.put("serviceId", serviceId + "");
        HttpRequest request = new HttpRequest(params,
                new Response.ErrorListener() {

                    @Override
                    public void onErrorResponse(VolleyError error) {
                        callBack.failed(error);
                    }
                }, new BaseRequest.ResponseCallback() {

            @Override
            public void error(int errorCode, String msg) {
                callBack.failed(errorCode, msg);
            }

            @Override
            public void success(Object obj, int resultCode,
                                int errorCode, String msg) {
                if (resultCode == 0 && errorCode == 0) {
                    callBack.success(obj);
                    callBack.success();
                } else {
                    callBack.failed(errorCode, msg);
                }
            }
        });
        request.setResponseDataType(HttpRequest.RESPONSE_DATA_TYPE_OBJECT);
        /*Type responseType = new TypeToken<>() {
        }.getType();
        request.setResponseType(responseType);*/
        BaseRequestUtil.getInstance().add(request);
        callBack.setUrl(request.getUrl());
    }

    public static void delTeam(int teamId, final BaseCallBack callBack) {
        Map<String, String> params = new HashMap<String, String>();
        params.put(HttpRequest.REQUEST_MODULES, EpaperAction.class.getName());
        params.put(HttpRequest.REQUEST_ACTION,
                EpaperAction.ACTION_DEL_TEAM);
        params.put("teamid", teamId + "");
        HttpRequest request = new HttpRequest(params,
                new Response.ErrorListener() {

                    @Override
                    public void onErrorResponse(VolleyError error) {
                        callBack.failed(error);
                    }
                }, new BaseRequest.ResponseCallback() {

            @Override
            public void error(int errorCode, String msg) {
                callBack.failed(errorCode, msg);
            }

            @Override
            public void success(Object obj, int resultCode,
                                int errorCode, String msg) {
                if (resultCode == 0 && errorCode == 0) {
                    callBack.success(obj);
                    callBack.success();
                } else {
                    callBack.failed(errorCode, msg);
                }
            }
        });
        request.setResponseDataType(HttpRequest.RESPONSE_DATA_TYPE_OBJECT);
        /*Type responseType = new TypeToken<>() {
        }.getType();
        request.setResponseType(responseType);*/
        BaseRequestUtil.getInstance().add(request);
        callBack.setUrl(request.getUrl());
    }

    public static void getEpageServiceClassids(int isDefault, int sId, int uId, String classids, final BaseCallBack callBack) {
        Map<String, String> params = new HashMap<String, String>();
        params.put(HttpRequest.REQUEST_MODULES, EpaperAction.class.getName());
        params.put(HttpRequest.REQUEST_ACTION,
                EpaperAction.ACTION_GET_EPAPER_SERVICE);
        params.put("isDefault", isDefault + "");
        params.put("sId", sId + "");
        params.put("uId", uId + "");
        params.put("classids", classids);
        HttpRequest request = new HttpRequest(params,
                new Response.ErrorListener() {

                    @Override
                    public void onErrorResponse(VolleyError error) {
                        callBack.failed(error);
                    }
                }, new BaseRequest.ResponseCallback() {

            @Override
            public void error(int errorCode, String msg) {
                callBack.failed(errorCode, msg);
            }

            @Override
            public void success(Object obj, int resultCode,
                                int errorCode, String msg) {
                if (resultCode == 0 && errorCode == 0) {
                    callBack.success(obj);
                    callBack.success();
                } else {
                    callBack.failed(errorCode, msg);
                }
            }
        });
        request.setResponseDataType(HttpRequest.RESPONSE_DATA_TYPE_OBJECT);
        /*Type responseType = new TypeToken<>() {
        }.getType();
        request.setResponseType(responseType);*/
        BaseRequestUtil.getInstance().add(request);
        callBack.setUrl(request.getUrl());
    }


    public static void getFollowTeachers(int brandId, final BaseCallBack callBack) {
        Map<String, String> params = new HashMap<String, String>();
        params.put(HttpRequest.REQUEST_MODULES, EpaperAction.class.getName());
        params.put(HttpRequest.REQUEST_ACTION,
                EpaperAction.ACTION_GET_FOLLOW_TEACHERS);
        params.put("brandId", brandId + "");
        HttpRequest request = new HttpRequest(params,
                new Response.ErrorListener() {

                    @Override
                    public void onErrorResponse(VolleyError error) {
                        callBack.failed(error);
                    }
                }, new BaseRequest.ResponseCallback() {

            @Override
            public void error(int errorCode, String msg) {
                callBack.failed(errorCode, msg);
            }

            @Override
            public void success(Object obj, int resultCode,
                                int errorCode, String msg) {
                if (resultCode == 0 && errorCode == 0) {
                    callBack.success(obj);
                    callBack.success();
                } else {
                    callBack.failed(errorCode, msg);
                }
            }
        });
        request.setResponseDataType(HttpRequest.RESPONSE_DATA_TYPE_OBJECT);
        Type responseType = new TypeToken<List<FollowTeacher>>() {
        }.getType();
        request.setResponseType(responseType);
        BaseRequestUtil.getInstance().add(request);
        callBack.setUrl(request.getUrl());
    }

    public static void getFollowWorkRecords(int brandId, long teacherId, int page, int pageSize, final BaseExtCallBack callBack) {
        Map<String, String> params = new HashMap<String, String>();
        params.put(HttpRequest.REQUEST_MODULES, EpaperAction.class.getName());
        params.put(HttpRequest.REQUEST_ACTION,
                EpaperAction.ACTION_GET_FOLLOW_WORK_RECORDS);
        params.put("brandId", brandId + "");
        params.put("teacherId", teacherId + "");
        params.put("page", page + "");
        params.put("pageSize", pageSize + "");
        HttpRequest request = new HttpRequest(params,
                new Response.ErrorListener() {

                    @Override
                    public void onErrorResponse(VolleyError error) {
                        callBack.failed(error);
                    }
                }, new BaseRequest.ResponseCallback() {

            @Override
            public void error(int errorCode, String msg) {
                callBack.failed(errorCode, msg);
            }

            @Override
            public void success(Object obj, int resultCode,
                                int errorCode, String msg) {
                if (resultCode == 0 && errorCode == 0) {
                    callBack.success(obj);
                    callBack.success();
                } else {
                    callBack.failed(errorCode, msg);
                }
            }
        });
        request.setResponseDataType(HttpRequest.RESPONSE_DATA_TYPE_OBJECT);
        Type responseType = new TypeToken<PublishWorkRecordsPageBean>() {
        }.getType();
        request.setResponseType(responseType);
        BaseRequestUtil.getInstance().add(request);
        callBack.setUrl(request.getUrl());
    }

    /**
     * 老师重置密码
     *
     * @param classId
     * @param userId
     * @param password
     */
    public static void setUserPassWord(int classId, int userId, String password, final BaseExtCallBack callBack) {

        Map<String, String> params = new HashMap<String, String>();
        params.put(HttpRequest.REQUEST_MODULES, EpaperAction.class.getName());
        params.put(HttpRequest.REQUEST_ACTION,
                EpaperAction.ACTION_SETPASSWORD_TEACHER);

        com.alibaba.fastjson.JSONObject publishWorkBean = new com.alibaba.fastjson.JSONObject();
        publishWorkBean.put("classId", classId);
        publishWorkBean.put("userId", userId);
        publishWorkBean.put("password", password);
        final String json = publishWorkBean.toString();
        HeadOverrideRequest request = new HeadOverrideRequest(Request.Method.POST, params,
                new Response.ErrorListener() {
                    @Override
                    public void onErrorResponse(VolleyError volleyError) {
                        CWLog.e("byou", volleyError.getMessage());
                        byte[] htmlBodyBytes = volleyError.networkResponse.data;
                        CWLog.e("byou", new String(htmlBodyBytes));
                        callBack.failed(volleyError);
                    }
                }, new BaseRequest.ResponseCallback() {
            @Override
            public void error(int errorCode, String msg) {
                callBack.failed(errorCode, msg);

            }

            @Override
            public void success(Object obj, int resultCode, int errorCode, String msg) {
                if (resultCode == 0 && errorCode == 0) {
                    if (null != callBack)
                        callBack.success(obj);
                } else {
                    if (null != callBack) {
                        callBack.failed(errorCode, msg);
                    }
                }
            }
        }) {
            @Override
            public byte[] getBody() throws AuthFailureError {
                return json.getBytes();
            }
        };

        request.setResponseDataType(HttpRequest.RESPONSE_DATA_TYPE_OBJECT);
        request.setResponseClazz(Boolean.class);
        request.setPriority(Request.Priority.HIGH);
        BaseRequestUtil.getInstance().add(request);
        callBack.setUrl(request.getUrl());
    }
}
